software to control a DC motor, preferably interfacing with a motor driver.
Revision 3:a0dc016b7cbb, committed 2011-07-15
- Comitter:
- kaushalpkk
- Date:
- Fri Jul 15 18:04:43 2011 +0000
- Parent:
- 2:46bca6d9dbda
- Commit message:
Changed in this revision
DCMotor.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/DCMotor.h Fri Jul 15 17:58:29 2011 +0000 +++ b/DCMotor.h Fri Jul 15 18:04:43 2011 +0000 @@ -3,18 +3,36 @@ #include "mbed.h" +/**DC motor control class with PWM control +* +* Example: +* @code +* +* #include "mbed.h" +* #include "DCMotor.h" +* +* DCMotor a(p21,p22,p23); +* DCMotor b(p24,p25,p26); +* int main() { +* a.driveIt(50); +* b.driveIt(50); +* } +* +* @endcode +*/ + class DCMotor { public: /** create a DCMotor object connected to the pins with speed control - * @param PWMPin PWM pin to control speed of motor - * @param PinA Digital output pin to connect to motor - * @param PinB Digital output pin to connect to motor + * @param PWMPin PWM pin to control speed of motor + * @param PinA Digital output pin to connect to motor + * @param PinB Digital output pin to connect to motor */ DCMotor(PinName PWMPin, PinName PinA, PinName PinB); /** drive Motor input range (-100 to 100). - * @param perCent PWM pin to control speed of motor + * @param perCent PWM pin to control speed of motor */ void driveIt(float);