Motor
Diff: motor.h
- Revision:
- 0:5cafacc2a607
- Child:
- 1:c97f8bcd6c0f
diff -r 000000000000 -r 5cafacc2a607 motor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/motor.h Mon Jul 29 20:25:33 2013 +0000 @@ -0,0 +1,25 @@ +#ifndef MOTOR_H +#define MOTOR_H + +#include "mbed.h" + +class Motor { +public: + Motor(PinName PWMpin, PinName dir1Pin, PinName dir2Pin); + + void setSpeed(int newSpeed); + int getSpeed(); + +private: + void pid(); + + InterruptIn interruptA; + InterruptIn interruptB; + + volatile int pulses; + + int prevState; + int currState; +}; + +#endif \ No newline at end of file