hallo

Dependencies:   Servo mbed pixy

Fork of PES1 by Gruppe 3

Revision:
13:7eba9911e196
Parent:
12:b9faf8637183
Child:
14:7e330f65f26e
--- a/main.cpp	Wed Apr 19 15:38:56 2017 +0000
+++ b/main.cpp	Wed Apr 19 15:57:28 2017 +0000
@@ -44,7 +44,7 @@
 
 
     int state = 0; // Diese Variable gibt an in welchem State man sich befindet
-
+    int tempState = 2;
 
     while(1) {
 
@@ -68,7 +68,7 @@
                     state = 5;
                 }
                 if(readCamera() == 0){
-                    state = 2;
+                    state = tempState;
                     }
 
 
@@ -79,6 +79,7 @@
                     pwmR = 0.4f;
                     time1 ++;
                     state = 1;
+                    tempState = 2;
                 } else {
                     time1 = 0;
                     pwmL = 0.5f;
@@ -96,6 +97,7 @@
                     pwmR = 0.4f;
                     time2 ++;
                     state = 1;
+                    tempState = 3;
                 } else {
                     time2 = 0;
                     pwmL = 0.5f;
@@ -119,12 +121,14 @@
                     pwmL = 0.55f;
                     pwmR = 0.45f;
                 }
+                state = 1;
 
                 break;
 
             case 5: // Aufnehmen des Klotzes
                 pwmL = 0.5f;
                 pwmR = 0.5f;
+                state = 1;
 
 
                 break;