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:
Tue Apr 25 13:44:12 2017 +0000
Parent:
17:caf5ae550f2e
Child:
19:2f44ecffaf30
Commit message:
anfahren funktioniert

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	Tue Apr 25 12:26:04 2017 +0000
+++ b/main.cpp	Tue Apr 25 13:44:12 2017 +0000
@@ -74,7 +74,7 @@
 
             case 2:
                 printf("2");
-                if(time1 < 20) {       // Im Kreis drehen für 1s
+                if(time1 < 15) {       // Im Kreis drehen für 1s
                     pwmL = 0.4f;
                     pwmR = 0.4f;
                     time1 ++;
@@ -92,7 +92,7 @@
             case 3:
                 printf("3");
                 roboter1.bandeAusweichen();
-                if(time2 < 40) {    // gerade aus fahren
+                if(time2 < 100) {    // gerade aus fahren
                     pwmL = 0.6f;
                     pwmR = 0.4f;
                     time2 ++;
@@ -111,16 +111,19 @@
                 printf("4");
                 roboter1.bandeAusweichen();
                 if(camValue == 1) {     // links fahren
-                    pwmL = 0.45f;
-                    pwmR = 0.45f;
+                    printf(".1;");
+                    pwmL = 0.425f;
+                    pwmR = 0.425f;
                 }
                 if(camValue == 2) {     // rechts fahren
-                    pwmL = 0.55f;
-                    pwmR = 0.55f;
+                    printf(".2;");
+                    pwmL = 0.575f;
+                    pwmR = 0.575f;
                 }
                 if(camValue == 3) {     // gerade fahren
-                    pwmL = 0.55f;
-                    pwmR = 0.45f;
+                    printf(".3;");
+                    pwmL = 0.6f;
+                    pwmR = 0.4f;
                 }
                 state = 1;
 
--- a/readCamera.cpp	Tue Apr 25 12:26:04 2017 +0000
+++ b/readCamera.cpp	Tue Apr 25 13:44:12 2017 +0000
@@ -29,14 +29,14 @@
                      
         
                     // soll drehen bis in stahl, fahren bis kegel, 25 pixel links rechts kegel
-                    if(xAxis < 185 && xAxis > 135  &&  yAxis > 155 && yAxis < 190 ) {              // wenn Klotz an Position zum aufnehmen
+                    if(xAxis < 200 && xAxis > 120  &&  yAxis > 155 && yAxis < 190 ) {              // wenn Klotz an Position zum aufnehmen
                         state = 4;
                         range = 1;
                     } else {
                         if (range == 1){         // fährt Strahl an
-                            if (xAxis < 155){
+                            if (xAxis < 140){
                                 state = 1;
-                            } else if (xAxis > 165){
+                            } else if (xAxis > 180){
                                 state = 2;
                             } else{   // fährt gerade
                                 state = 3;