Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
motor.cpp
- Committer:
- martinsimpson
- Date:
- 2018-02-01
- Revision:
- 0:51c12cc34baf
- Child:
- 1:3ca91ad8e927
File content as of revision 0:51c12cc34baf:
#include "motor.h"
Motor::Motor(PinName pinName1, PinName pinName2) : pin1(pinName1), pin2(pinName2)
{
}
void Motor::Fwd(float duty)
{
this->pin1 = 0.0f;
this->pin2 = duty;
}
void Motor::Rev(float duty)
{
this->pin1 = duty;
this->pin2 = 0.0f;
}
void Motor::Period_in_ms(int msPeriod)
{
this->pin1.period_ms(msPeriod);
this->pin2.period_ms(msPeriod);
}