This library is an attempt to encapsulate the Pololu motor board.
Diff: Motor.h
- Revision:
- 0:b7c4b6de973e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.h Mon Feb 11 19:49:50 2013 +0000 @@ -0,0 +1,27 @@ +#ifndef MBED_MOTOR_H +#define MBED_MOTOR_H + +#include "mbed.h" + +class Motor +{ +public: + + + Motor(PinName pwm, PinName dir1, PinName dir2); + + float speed(float speed, bool direction); + float speed(float speed); + Motor& operator= (float speed); + + +protected: + PwmOut _pwm; + DigitalOut _dir1; + DigitalOut _dir2; + bool _direction; + + +}; + +#endif