Antonia Baumgartner / Mbed 2 deprecated YB_copy

Dependencies:   mbed

Fork of Versuch21 by Antonia Baumgartner

Revision:
4:3c6d2c035243
Parent:
3:f44ef28cfb2d
Child:
5:93d3efe46493
--- a/Classes/Motion.cpp	Sun Apr 29 11:29:00 2018 +0000
+++ b/Classes/Motion.cpp	Tue May 01 11:42:38 2018 +0000
@@ -27,13 +27,10 @@
     controller.resetCounter();
     int lastCountRight = counterRight.read();
 
-    while(counterRight.read()-lastCountRight>(-1.08*1260)) {
+    while(counterRight.read()-lastCountRight>(-1.19*1260)) {
         controller.setDesiredSpeedLeft(150.0f);             //Drehzahl in [rpm]
         controller.setDesiredSpeedRight(150.0f);
-
-
     }
-
     controller.setDesiredSpeedLeft(0.0f);                   //Drehzahl in [rpm]
     controller.setDesiredSpeedRight(0.0f);
 
@@ -48,7 +45,7 @@
     int lastCountLeft = counterLeft.read();
     
     if (Sensor1.read() == 0) {
-        while(counterLeft.read()-lastCountLeft>(-2.0*1260) || Sensor1.read() == 0) {
+        while(counterLeft.read()-lastCountLeft>(-2.45*1260)) {
             spurhaltung.speedl();
             spurhaltung.speedr();
             controller.setDesiredSpeedLeft(-spurhaltung.speedr());   //Drehzahl in [rpm]
@@ -66,12 +63,10 @@
     controller.resetCounter();
     int lastCountLeft = counterLeft.read();
 
-    while(counterLeft.read()-lastCountLeft<(1.08*1260)) {
+    while(counterLeft.read()-lastCountLeft<(1.19*1260)) {
         controller.setDesiredSpeedLeft(-150.0f);            //Drehzahl in [rpm]
         controller.setDesiredSpeedRight(-150.0f);
-
     }
-
     controller.setDesiredSpeedLeft(0.0f); //Drehzahl in [rpm]
     controller.setDesiredSpeedRight(0.0f);
 
@@ -84,13 +79,10 @@
     controller.resetCounter();
     int lastCountRight = counterRight.read();
 
-    while(counterRight.read()-lastCountRight>(-2.16*1260)) {
+    while(counterRight.read()-lastCountRight>(-2.38*1260)) {
         controller.setDesiredSpeedLeft(150.0f); //Drehzahl in [rpm]
         controller.setDesiredSpeedRight(150.0f);
-
-
     }
-
     controller.setDesiredSpeedLeft(0.0f); //Drehzahl in [rpm]
     controller.setDesiredSpeedRight(0.0f);
 }