ai_car1
Dependencies: mbed ai_car ros_lib_melodic
Diff: Actuator/Motor.h
- Revision:
- 0:a35213e1e14e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Actuator/Motor.h Mon May 03 07:22:52 2021 +0000 @@ -0,0 +1,22 @@ +#ifndef MBED_MOTOR_H +#define MBED_MOTOR_H + +#include "mbed.h" + +#define FORWARD 'f' +#define BACKWARD 'b' +#define BREAK 's' + +class Motor +{ +private: + PwmOut IN1_, IN2_; + DigitalOut INH1_, INH2_; + +public: + Motor(PinName IN1, PinName IN2,PinName INH1, PinName INH2); + + void setSpeed_percent(float percent, char direction); +}; + +#endif