Mouse code for the MacroRat
Diff: motor.h
- Revision:
- 12:5790e56a056f
- Parent:
- 8:a0760acdc59e
- Child:
- 13:2032db00f168
diff -r 8fc2b703086b -r 5790e56a056f motor.h --- a/motor.h Sun May 07 01:13:42 2017 +0000 +++ b/motor.h Fri May 12 23:25:07 2017 +0000 @@ -19,7 +19,7 @@ { public: Motor( PinName f, PinName b, PinName e ) : - forw( f ), back( b ), enableMotor( e ) + forw( f ), back( b ), enableMotor( e ), maxSpeed( 0.5 ) { enableMotor.write( 1 ); } @@ -28,11 +28,13 @@ void forward( double voltage ); void brake(); void coast(); + void move( double voltage ); private: PwmOut forw; PwmOut back; DigitalOut enableMotor; + const double maxSpeed; }; //QEI leftWheel(