für holdor

Dependencies:   Servo mbed pixy

Fork of PES by Gruppe 3

Revision:
22:ffd36f07c046
Parent:
21:d05dee0d1a7d
Child:
23:6feed75772b6
--- a/readCamera.cpp	Mon May 01 09:47:45 2017 +0000
+++ b/readCamera.cpp	Mon May 01 10:18:19 2017 +0000
@@ -9,7 +9,7 @@
 static int range = 1;           // 1: fährt strahl an, 2: fährt kegel an
 static int state = 0;
 static double distance = 0;
-static int yLimit = 155;
+static int yLimit = 40;
 int j;
 uint16_t blocks;
 
@@ -27,11 +27,12 @@
                 for (j = 0; j < blocks; j++) {
                     int xAxis = pixy.blocks[j].x;
                     int yAxis = pixy.blocks[j].y;
+                    //printf("%d, %d\n\r", xAxis, yAxis);
                     
                      
         
                     // soll drehen bis in stahl, fahren bis kegel, 25 pixel links rechts kegel
-                    if(xAxis < 180 && xAxis > 140  &&  yAxis > 155 && yAxis < yLimit ) {              // wenn Klotz an Position zum aufnehmen
+                    if(xAxis < 180 && xAxis > 140  &&  yAxis > 0 && yAxis < yLimit ) {              // wenn Klotz an Position zum aufnehmen
                         state = 400;
                         range = 1;
                     } else {
@@ -70,7 +71,6 @@
             }
         }
         //printf("%d\n\r",state);
-        //printf("%d, %d\n\r", xAxis, yAxis);
         return (double) state;
     }
 }
\ No newline at end of file