Helvijs Kiselis
/
Micromouse
Algorithmus
Diff: main.cpp
- Revision:
- 18:3309329d5f42
- Parent:
- 17:8a8758bfe3c5
- Child:
- 19:6cd6cc5c8b4c
--- a/main.cpp Mon May 07 18:28:34 2018 +0000 +++ b/main.cpp Mon May 07 19:52:54 2018 +0000 @@ -97,7 +97,7 @@ route[r] = LEFT; } - motion.runTask(route,r,true); + //motion.runTask(route,r,true); printf("Schritt: %d, Befehl: %d\n", r, route[r]); route[r] = 0; r--; @@ -112,8 +112,8 @@ int route[200] = {0}; int r = 0; - volatile int junction[20] = {0}; - volatile int j = 0; + int junction[20] = {0}; + int j = 0; short lWall; short cWall; @@ -241,7 +241,7 @@ route[r] = LEFT; } - motion.runTask(route,r,true); + motion.runTask(route,r,true,junction[j]); printf("Schritt: %d, Befehl: %d\n", r, route[r]); //At work!!!!! route[r] = 0; r--; @@ -328,7 +328,7 @@ route[r] = LEFT; } - motion.runTask(route,r,true); + motion.runTask(route,r,true,junction[j]); printf("Schritt: %d, Befehl: %d\n", r, route[r]); route[r] = 0; r--; @@ -377,7 +377,7 @@ switch (route[r]) { case MOVE: - motion.runTask(route,r,true); + motion.runTask(route,r,true, junction[j]); printf("Schritt: %d, Befehl: %d\n", r, route[r]); r--; break; @@ -405,7 +405,7 @@ route[r] = LEFT; } //Run tasks in declining order - motion.runTask(route,r,true); + motion.runTask(route,r,true, junction[j]); printf("Schritt: %d, Befehl: %d\n", r, route[r]); route[r] = 0; r--; @@ -462,7 +462,7 @@ float distanceC = irSensorC.readC(); float distanceR = irSensorR.readR(); - motion.runTask(route,r,false); + motion.runTask(route,r,false,junction[j]); r++; if (route[r] == 0) {