werkend!
Fork of MotorThrottle by
Diff: Motor.cpp
- Revision:
- 2:1de1be9f0ab7
- Parent:
- 0:aefd03ad04e6
--- 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(){