toshi mura
/
NRP2020_main
gjyrjyykkudt
Motor/Motor.h
- Committer:
- M_souta
- Date:
- 2020-01-20
- Revision:
- 0:db8d4af513c0
- Child:
- 1:5b0303768126
File content as of revision 0:db8d4af513c0:
#ifndef MOTOR_H_ #define MOTOR_H_ #include "mbed.h" typedef enum dire { FREE = 0, FOR = 1, BACK = 2, BRAKE = 3, }dire; class MOTOR { public: // MOTOR(PinName D1, PinName D2, PinName pwm); /* direction FREE FOR BACK BRAKE */ /* pwm pwm is 0 ~ 100(%) */ // durection and pwm set void Dir(dire mode, uint8_t pwm); // direction set void Dir(dire mode); // pwm set void PWM(uint8_t pwm); private: DigitalOut D1_; DigitalOut D2_; PwmOut pwm_; }; #endif //MOTOR_H_