MOtor control Pololu

Dependencies:   Encoder HIDScope mbed-dsp mbed

Revision:
2:5f5b229b004d
Parent:
1:5ac85aad9da4
Child:
4:1a53b06eeb7f
--- a/main.cpp	Thu Sep 26 13:08:21 2013 +0000
+++ b/main.cpp	Tue Oct 08 14:55:40 2013 +0000
@@ -60,8 +60,8 @@
         while(!looptimerflag);
         looptimerflag = false;
         setpoint = (getpotAverage())*2000;
-        new_pwm = (setpoint - motor1.getPosition())*.001;
-        //new_pwm = pid(setpoint, motor1.getPosition());
+        //new_pwm = (setpoint - motor1.getPosition())*.001;
+        new_pwm = pid(setpoint, motor1.getPosition());
         coerce(&new_pwm, -1,1);
         if(new_pwm > 0)
             motordir = 1;