final

Dependencies:   Encoder HIDScope MODSERIAL TouchButton mbed-dsp mbed

Fork of Robot1_11 by BMT M9 Groep01

Revision:
10:22047a8e634a
Parent:
9:ba7f541cef3a
Child:
12:e59b2bdb8d0e
--- a/main.cpp	Thu Oct 30 16:24:22 2014 +0000
+++ b/main.cpp	Fri Oct 31 08:29:50 2014 +0000
@@ -619,7 +619,7 @@
     if (motor1.getPosition()>= ANGLEMIN && toestand != SLAAN) {
         toestand = WACHTEN;
         //out_i=0;
-        //pid(0,0,true); 
+        pid(0,0,true); 
         pc.printf("if1\n");
     }
     if (snelheidsstand != 0 && toestand == WACHTEN && stop == 0) { // stop = 0 in het begin let op dat dit na reset nog zo is
@@ -638,13 +638,13 @@
     if (toestand == SLAAN && motor1.getPosition() <= ANGLEMAX) {
         pc.printf("toestand = terugkeren\n\r");
         //out_i=0;
-        //pid(0,0,true);
+        pid(0,0,true);
         toestand = TERUGKEREN; 
         stop = 1; //zorgt dat hij niet weer gaat slaan tot er gereset is...
     }
     if (toestand == TERUGKEREN) {
         pc.printf("motor gaat terugkeren\n\r");
-        new_pwm=pid(setspeed, motor1.getSpeed(),false);
+        pid(setspeed, motor1.getSpeed(),false);
         
         pwm_motor1.write(new_pwm);
         pc.printf("new pwm %f\r\n",new_pwm);
@@ -655,7 +655,7 @@
         pc.printf("ifwachten\n");
     }
     if (toestand == SLAAN) {
-        pid(setspeed, motor1.getSpeed(),false);
+        new_pwm=pid(setspeed, motor1.getSpeed(),false);
         motordir1 = 1;
         pwm_motor1.write(new_pwm);
         pc.printf("SLAAN\n");