Library for driving a motor with a DRV8833 motor driver or similar.
Diff: Motor.h
- Revision:
- 0:0d650a332dcc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.h Sun Oct 19 07:51:25 2014 +0000 @@ -0,0 +1,20 @@ +#ifndef MOTOR_H +#define MOTOR_H + +#include "mbed.h" + + +class Motor +{ +public: + Motor(PinName pin1, PinName pin2); + void speed(float value); + Motor& operator=(float value); + void brake(); + +private: + PwmOut pwm1; + PwmOut pwm2; +}; + +#endif // MOTOR_H \ No newline at end of file