ai_car1
Dependencies: mbed ai_car ros_lib_melodic
Actuator/Motor.h@0:a35213e1e14e, 2021-05-03 (annotated)
- Committer:
- wngudwls000
- Date:
- Mon May 03 07:22:52 2021 +0000
- Revision:
- 0:a35213e1e14e
45
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wngudwls000 | 0:a35213e1e14e | 1 | #ifndef MBED_MOTOR_H |
wngudwls000 | 0:a35213e1e14e | 2 | #define MBED_MOTOR_H |
wngudwls000 | 0:a35213e1e14e | 3 | |
wngudwls000 | 0:a35213e1e14e | 4 | #include "mbed.h" |
wngudwls000 | 0:a35213e1e14e | 5 | |
wngudwls000 | 0:a35213e1e14e | 6 | #define FORWARD 'f' |
wngudwls000 | 0:a35213e1e14e | 7 | #define BACKWARD 'b' |
wngudwls000 | 0:a35213e1e14e | 8 | #define BREAK 's' |
wngudwls000 | 0:a35213e1e14e | 9 | |
wngudwls000 | 0:a35213e1e14e | 10 | class Motor |
wngudwls000 | 0:a35213e1e14e | 11 | { |
wngudwls000 | 0:a35213e1e14e | 12 | private: |
wngudwls000 | 0:a35213e1e14e | 13 | PwmOut IN1_, IN2_; |
wngudwls000 | 0:a35213e1e14e | 14 | DigitalOut INH1_, INH2_; |
wngudwls000 | 0:a35213e1e14e | 15 | |
wngudwls000 | 0:a35213e1e14e | 16 | public: |
wngudwls000 | 0:a35213e1e14e | 17 | Motor(PinName IN1, PinName IN2,PinName INH1, PinName INH2); |
wngudwls000 | 0:a35213e1e14e | 18 | |
wngudwls000 | 0:a35213e1e14e | 19 | void setSpeed_percent(float percent, char direction); |
wngudwls000 | 0:a35213e1e14e | 20 | }; |
wngudwls000 | 0:a35213e1e14e | 21 | |
wngudwls000 | 0:a35213e1e14e | 22 | #endif |