Program for testing motion boards (double motor controller)
Program to test motion boards (double motor controller).
The mbed board reads from a joystick and then sends the commands to the motor board (l293d), which lets the small caterpillar go ahead, go back and turn.
dc_motor.hpp@0:5307ae36f268, 2014-06-14 (annotated)
- Committer:
- mariob
- Date:
- Sat Jun 14 21:56:12 2014 +0000
- Revision:
- 0:5307ae36f268
example to test motion boards
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mariob | 0:5307ae36f268 | 1 | #ifndef DC_MOTOR |
mariob | 0:5307ae36f268 | 2 | #define DC_MOTOR |
mariob | 0:5307ae36f268 | 3 | |
mariob | 0:5307ae36f268 | 4 | #include "mbed.h" |
mariob | 0:5307ae36f268 | 5 | |
mariob | 0:5307ae36f268 | 6 | class DC_motor |
mariob | 0:5307ae36f268 | 7 | { |
mariob | 0:5307ae36f268 | 8 | PwmOut pwm; |
mariob | 0:5307ae36f268 | 9 | DigitalOut dir; |
mariob | 0:5307ae36f268 | 10 | |
mariob | 0:5307ae36f268 | 11 | public: |
mariob | 0:5307ae36f268 | 12 | |
mariob | 0:5307ae36f268 | 13 | DC_motor (PinName ppwm, PinName pdir); |
mariob | 0:5307ae36f268 | 14 | |
mariob | 0:5307ae36f268 | 15 | void speed(float speed); |
mariob | 0:5307ae36f268 | 16 | |
mariob | 0:5307ae36f268 | 17 | }; |
mariob | 0:5307ae36f268 | 18 | |
mariob | 0:5307ae36f268 | 19 | #endif |