Gruppe 3 / Mbed 2 deprecated PES1

Dependencies:   Servo mbed pixy

Fork of PES by Gruppe 3

Files at this revision

API Documentation at this revision

Comitter:
itslinear
Date:
Wed Apr 19 15:57:28 2017 +0000
Parent:
12:b9faf8637183
Child:
14:7e330f65f26e
Commit message:
new

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
readCamera.h Show annotated file Show diff for this revision Revisions of this file
--- 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;
--- a/readCamera.h	Wed Apr 19 15:38:56 2017 +0000
+++ b/readCamera.h	Wed Apr 19 15:57:28 2017 +0000
@@ -3,6 +3,8 @@
 
 #include <mbed.h>
 #include "Pixy.h"
+#include "PixyLink.h"
+#include "PixyLinkI2C.h"
 
 int readCamera();