Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: include/motor.hpp
- Revision:
- 37:bf257a0154db
- Parent:
- 35:a4e89e78d034
- Child:
- 38:922f2584bdfd
--- a/include/motor.hpp Sun Nov 24 20:18:17 2013 +0000 +++ b/include/motor.hpp Sun Nov 24 20:38:59 2013 +0000 @@ -7,13 +7,13 @@ class Motor { public: - Motor(PinName aPin, PinName fPin, PinName bPin, PinName pwmPin, PinName encA, PinName encB); + Motor(PinName aPin, PinName fPin, PinName bPin, PinName pwmPin, QEI &enc); void start(); void stop(); void setTorque(float t); void Control(); - float getMotorPos(); + int getPos(); float getCurrent(); static float filterLowPass(float old, float currentIn, float alphar); void setPos(float pos); @@ -30,7 +30,7 @@ DigitalOut Forward; DigitalOut Backward; PwmOut pwmOut; - QEI encoder; + QEI& encoder; float speed; float freq;