Antonia Baumgartner / Mbed 2 deprecated Versuch21

Dependencies:   mbed

Fork of Versuch20 by Alexander Wyss

Revision:
3:f44ef28cfb2d
Parent:
2:efa9a78591da
Child:
4:3c6d2c035243
--- a/Classes/LHR.cpp	Wed Apr 25 11:16:16 2018 +0000
+++ b/Classes/LHR.cpp	Sun Apr 29 11:29:00 2018 +0000
@@ -6,6 +6,7 @@
 #include "IRSensorK.h"
 #include "IRSensorZ.h"
 
+
 using namespace std;
 
 LHR::LHR(IRSensorGF& Sensor1, IRSensorG& Sensor2, IRSensorG& Sensor3, IRSensorK& Sensor4, IRSensorK& Sensor5, IRSensorZ& Sensor6):
@@ -19,7 +20,7 @@
 
 int LHR::moving()
 {
-    if (1/*Sensor6.read() > 0*/) {                  //Ziel erreicht
+    while(Sensor6.read() == 0) {                  //Ziel erreicht
         
         if(Sensor4.read() == 0) {                   
             D=1;                                    //links Drehen
@@ -30,8 +31,7 @@
         } else{
             D=4;
         }
-    } else {
-        D=0;
+        
     }
     return D;
 }