werkend!
Fork of MotorThrottle by
Revision 2:1de1be9f0ab7, committed 2017-10-30
- Comitter:
- jordymorsinkhof
- Date:
- Mon Oct 30 15:51:11 2017 +0000
- Parent:
- 1:f808e6189b2b
- Commit message:
- Changed nothing;
Changed in this revision
Motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Motor.cpp Mon Oct 30 13:52:12 2017 +0000 +++ b/Motor.cpp Mon Oct 30 15:51:11 2017 +0000 @@ -9,6 +9,8 @@ { SetPID(1,0,0); _GearRatio=1; + MotorThrottle=0; + MotorDirection=0; } void Motor::GotoPos(float Rad){ @@ -47,6 +49,7 @@ MotorDirection=0; MotorThrottle=0.0f; encoder.reset((int)4200.0f*_GearRatio*(HomingPos/2.0f/3.1415)); + Stop(); } void Motor::SetPID(float P,float Ti,float Td){ @@ -62,7 +65,7 @@ } void Motor::SetOutputLimits(float Omin, float Omax){ - controller.setInputLimits(Omin,Omax); + controller.setOutputLimits(Omin,Omax); } void Motor::Stop(){