Alexander Lüthard / Mbed 2 deprecated Micromouse

Dependencies:   mbed

Fork of Micromouse by Helvijs Kiselis

Files at this revision

API Documentation at this revision

Comitter:
luethale
Date:
Thu May 10 16:33:32 2018 +0000
Parent:
18:3309329d5f42
Commit message:
Alle Printf's auskommentiert

Changed in this revision

Motion.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Motion.cpp	Mon May 07 19:52:54 2018 +0000
+++ b/Motion.cpp	Thu May 10 16:33:32 2018 +0000
@@ -166,7 +166,7 @@
                 enableMotorDriver = 1;
             }
             
-            if (lineSensor.read() == 1.0f) {
+            if (lineSensor.read() >= 0.85f) {
                 line = 1;  
             }
             
--- a/main.cpp	Mon May 07 19:52:54 2018 +0000
+++ b/main.cpp	Thu May 10 16:33:32 2018 +0000
@@ -28,16 +28,14 @@
 
 //Sensors:
     
-    AnalogIn lineSensor(PA_4);
+    AnalogIn lineSensor(PC_5);
     AnalogIn distance2(PC_3);
     AnalogIn distance4(PB_1);
     AnalogIn distance1(PC_2);
-    AnalogIn distance3(PC_5);
 
     IRSensor irSensorL (distance2);
     IRSensor irSensorC (distance4);
     IRSensor irSensorR (distance1);
-    IRSensor irSensorB (distance3);
     
     Timer t1;
 
@@ -98,7 +96,7 @@
             }
             
             //motion.runTask(route,r,true);
-            printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//            printf("Schritt: %d, Befehl: %d\n", r, route[r]);
             route[r] = 0;
             r--;
         } while (junc < r );   
@@ -163,7 +161,7 @@
                     }
                 }
             
-                printf("Kreuzung: %d Schritt: %d\n", j, r);
+//                printf("Kreuzung: %d Schritt: %d\n", j, r);
             }
             //No wall left
             if (lWall == 0) {
@@ -171,7 +169,7 @@
                 if (route[r] == LEFT) {
                 
                     route[r] = MOVE;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                 
                     motion.rotateL();
@@ -181,10 +179,10 @@
                 }else if (route[r] == MOVE) {
                 
                     route[r] = RIGHT;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                     route[r] = MOVE;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                 
                     motion.rotateL();
@@ -195,7 +193,7 @@
                     // Kreuzung führt zu Sackgassen -> löschen
                     junction[j] = 0;                                            /*Änderung alex*/
                     //if (j > 0) {j--;}
-                    printf("Kreuzung %d Schritt %d geloscht\n", j, r);
+//                    printf("Kreuzung %d Schritt %d geloscht\n", j, r);
                     j -= 1;
                     //reverseToJunction(junction[j], r, route);
                 
@@ -242,7 +240,7 @@
                         }
                     
                         motion.runTask(route,r,true,junction[j]);
-                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);                   //At work!!!!!
+//                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                         route[r] = 0;
                         r--;
                         
@@ -253,10 +251,10 @@
                 }else{
                     
                     route[r] = LEFT;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                     route[r] = MOVE;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                 
                 
@@ -270,10 +268,10 @@
                 if (route[r] == LEFT) {
                 
                     route[r] = RIGHT;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
                     route[r] = MOVE;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
             
                     motion.scanMove();
@@ -283,7 +281,7 @@
                 
                     junction[j] = 0;                                            /*Änderung alex*/
                     //if (j > 0) {j--;}
-                    printf("Kreuzung %d Schritt %d geloscht\n", j, r);
+//                    printf("Kreuzung %d Schritt %d geloscht\n", j, r);
                     j -= 1;
                     //reverseToJunction(junction[j], r, route);
                 
@@ -329,18 +327,18 @@
                         }
                     
                         motion.runTask(route,r,true,junction[j]);
-                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                         route[r] = 0;
                         r--;
                         
                     } while (junction[j] < r );
                     motion.stop();
-                    printf("Loop stop\n");
+//                    printf("Loop stop\n");
                 
                 }else{
                 
                     route[r] = MOVE;
-                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                    printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                     r++;
             
                     motion.scanMove();
@@ -349,10 +347,10 @@
             }else if (rWall == 0) {
             
                 route[r] = RIGHT;
-                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                 r++;
                 route[r] = MOVE;
-                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                 r++;
             
                 motion.rotateR();
@@ -363,7 +361,7 @@
             }else if ((lWall + cWall + rWall) == 3) {
             
                 motion.rotate180();
-                printf("Sackgasse Schritt: %d\n", r);
+//                printf("Sackgasse Schritt: %d\n", r);
                 r--;
                 t1.reset();
                 t1.start();
@@ -378,7 +376,7 @@
                         switch (route[r]) {
                             case MOVE: 
                                 motion.runTask(route,r,true, junction[j]);
-                                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                                printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                                 r--;
                                 break;
                             case LEFT:
@@ -406,7 +404,7 @@
                         }
                         //Run tasks in declining order
                         motion.runTask(route,r,true, junction[j]);
-                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);
+//                        printf("Schritt: %d, Befehl: %d\n", r, route[r]);
                         route[r] = 0;
                         r--;
                     }