First import from throwbot
motors.h@1:201d986498c7, 2014-10-05 (annotated)
- Committer:
- Throwbot
- Date:
- Sun Oct 05 12:20:47 2014 +0000
- Revision:
- 1:201d986498c7
- Parent:
- 0:5b2bf6e79b07
Motors code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Throwbot | 0:5b2bf6e79b07 | 1 | #ifndef MOTORS_H |
Throwbot | 0:5b2bf6e79b07 | 2 | #define MOTORS_H |
Throwbot | 0:5b2bf6e79b07 | 3 | |
Throwbot | 0:5b2bf6e79b07 | 4 | #include "mbed.h" |
Throwbot | 0:5b2bf6e79b07 | 5 | #include "TB6612.h" |
Throwbot | 0:5b2bf6e79b07 | 6 | |
Throwbot | 0:5b2bf6e79b07 | 7 | class Motors |
Throwbot | 0:5b2bf6e79b07 | 8 | { |
Throwbot | 0:5b2bf6e79b07 | 9 | private: |
Throwbot | 0:5b2bf6e79b07 | 10 | |
Throwbot | 0:5b2bf6e79b07 | 11 | void stop(void const *args); |
Throwbot | 0:5b2bf6e79b07 | 12 | |
Throwbot | 0:5b2bf6e79b07 | 13 | public: |
Throwbot | 0:5b2bf6e79b07 | 14 | |
Throwbot | 0:5b2bf6e79b07 | 15 | TB6612 * Left; |
Throwbot | 0:5b2bf6e79b07 | 16 | TB6612 * Right; |
Throwbot | 0:5b2bf6e79b07 | 17 | DigitalOut enable; |
Throwbot | 0:5b2bf6e79b07 | 18 | |
Throwbot | 0:5b2bf6e79b07 | 19 | Motors(TB6612 * L, TB6612 * R, PinName STBY); |
Throwbot | 0:5b2bf6e79b07 | 20 | |
Throwbot | 1:201d986498c7 | 21 | void flip(); |
Throwbot | 1:201d986498c7 | 22 | void reverse(bool m); //reverse one of the motors (0=right, 1=left) |
Throwbot | 0:5b2bf6e79b07 | 23 | }; |
Throwbot | 0:5b2bf6e79b07 | 24 | #endif |