Mouse code for the MacroRat
Diff: motor.h
- Revision:
- 15:b80555a4a8b9
- Parent:
- 13:2032db00f168
diff -r 9e7bb03ddccb -r b80555a4a8b9 motor.h --- a/motor.h Sat May 13 23:49:02 2017 +0000 +++ b/motor.h Sun May 14 04:45:21 2017 +0000 @@ -19,9 +19,8 @@ { public: Motor( PinName f, PinName b, PinName e ) : - forw( f ), back( b ), enableMotor( e ), maxSpeed( 0.2 ), minSpeed(0.07) + enableForw( f ), enableBack( b ), motorSpeed( e ), maxSpeed( 0.2 ), minSpeed(0.07) { - enableMotor.write( 1 ); } void backward( double voltage ); @@ -31,9 +30,9 @@ void move( double voltage ); private: - PwmOut forw; - PwmOut back; - DigitalOut enableMotor; + DigitalOut enableForw; + DigitalOut enableBack; + PwmOut motorSpeed; const double maxSpeed; const double minSpeed; };