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:
Shukle
Date:
Mon May 01 10:18:19 2017 +0000
Parent:
21:d05dee0d1a7d
Child:
23:6feed75772b6
Commit message:
?berarbeited;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
readCamera.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon May 01 09:47:45 2017 +0000
+++ b/main.cpp	Mon May 01 10:18:19 2017 +0000
@@ -53,7 +53,7 @@
     while(1) { 
 
         double camValue = readCamera();
-       
+        printf("\n\rcamValue: %f\n\r",camValue);
 
         switch(state) {
 
@@ -116,7 +116,7 @@
 
             case 4: // Roboter erkennt gründer Klotz, Klotz wird angefahren
                 printf("4");
-                double maxWert = 0.3; // Maximale Werte für die pmL und pmR 
+                double maxWert = 0.2; // Maximale Werte für die pmL und pmR 
                 roboter1.bandeAusweichen();
                 if(camValue >= 100 && camValue <200 ) {     // links fahren, wenn wir Werte von 100 bis 199 haben
                    camValue = camValue -99;
--- 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