werkend!

Dependencies:   PID QEI_adapted

Fork of MotorThrottle by Bram S

Revision:
2:1de1be9f0ab7
Parent:
0:aefd03ad04e6
diff -r f808e6189b2b -r 1de1be9f0ab7 Motor.cpp
--- 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(){