software to control a DC motor, preferably interfacing with a motor driver.
DCMotor.h@0:c92be90656b7, 2011-07-15 (annotated)
- Committer:
- kaushalpkk
- Date:
- Fri Jul 15 10:44:21 2011 +0000
- Revision:
- 0:c92be90656b7
- Child:
- 1:88772267f757
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kaushalpkk | 0:c92be90656b7 | 1 | #ifndef MBED_DCMOTOR_H |
kaushalpkk | 0:c92be90656b7 | 2 | #define MBED_DCMOTOR_H |
kaushalpkk | 0:c92be90656b7 | 3 | |
kaushalpkk | 0:c92be90656b7 | 4 | #include "mbed.h" |
kaushalpkk | 0:c92be90656b7 | 5 | |
kaushalpkk | 0:c92be90656b7 | 6 | class DCMotor { |
kaushalpkk | 0:c92be90656b7 | 7 | |
kaushalpkk | 0:c92be90656b7 | 8 | public: |
kaushalpkk | 0:c92be90656b7 | 9 | DCMotor(PinName PWMPin, PinName PinA, PinName PinB); |
kaushalpkk | 0:c92be90656b7 | 10 | void driveIt(float); |
kaushalpkk | 0:c92be90656b7 | 11 | |
kaushalpkk | 0:c92be90656b7 | 12 | protected: |
kaushalpkk | 0:c92be90656b7 | 13 | PwmOut _PWMPin; |
kaushalpkk | 0:c92be90656b7 | 14 | DigitalOut _PinA; |
kaushalpkk | 0:c92be90656b7 | 15 | DigitalOut _PinB; |
kaushalpkk | 0:c92be90656b7 | 16 | }; |
kaushalpkk | 0:c92be90656b7 | 17 | |
kaushalpkk | 0:c92be90656b7 | 18 | #endif |