emg zooi er op

Dependencies:   HIDScope MODSERIAL QEI mbed

Fork of Wearealltogheter_goed by Timo de Vries

Revision:
25:6dcf79346c40
Parent:
24:bdd74b91abbb
Child:
26:c640851fa1e7
diff -r bdd74b91abbb -r 6dcf79346c40 main.cpp
--- a/main.cpp	Thu Oct 27 08:12:25 2016 +0000
+++ b/main.cpp	Thu Oct 27 09:10:32 2016 +0000
@@ -218,10 +218,10 @@
 }
 void GoBack()
 {
-    while (GetPositionM2() > 0) {
+    while (GetPositionM2() < 0) {
         M3_Speed = 0;
         M2_Speed = 1;
-        M2_Rotate = 0;
+        M2_Rotate = 1;
         pc.printf("rotation %f translation %f \n \r ", GetRotationM3(), GetPositionM2());
         led_r = 0;
     }
@@ -243,13 +243,14 @@
 
 void Burgerflip()
 {
-    if (GetPositionM2() > afstand) {
+    pc.printf("get position %f, get rotation %f \n \r", GetPositionM2(), GetRotationM3());
+    if (GetPositionM2()< afstand) {
         M3_Speed = 0.2;
-        M3_Rotate = 1;
+        M3_Rotate = 0;
         M2_Speed = 0;
-    } else if (GetPositionM2() < afstand) {
+    } else if (GetPositionM2() > afstand) {
         M2_Speed = 1;
-        M2_Rotate = 1;
+        M2_Rotate = 0;
 
     }
     if (GetRotationM3() > 150) {
@@ -284,7 +285,7 @@
 
         }
         if (calibrate == true) {
-            pc.printf("calibration complete, left = %f, right = %f \n \r", threshold_Left, threshold_Right);
+            //pc.printf("calibration complete, left = %f, right = %f \n \r", threshold_Left, threshold_Right);
             GetDirections();
             if (draairechts == true) {
                 M1_Speed = 0.2;
@@ -305,7 +306,7 @@
             if ((draailinks == false) && (draairechts == false)) {
                 M1_Speed = 0;
             }
-            pc.printf("rotation %f translation %f \n \r ", GetRotationM3(), GetPositionM2());
+            //pc.printf("rotation %f translation %f \n \r ", GetRotationM3(), GetPositionM2());
             /* pulses = 8400 */
             /*empty loop, sample() is executed periodically*/
         }