PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
127:6bde4483ce7b
Parent:
125:d0b2057272d0
Child:
130:0d6c072b23ca
Child:
131:8ae08f41bb43
diff -r d05c45917280 -r 6bde4483ce7b source/Main.cpp
--- a/source/Main.cpp	Sun May 14 13:40:17 2017 +0000
+++ b/source/Main.cpp	Sun May 14 14:40:12 2017 +0000
@@ -2,6 +2,7 @@
 
 
 int state = 10;
+int old_state = 0;
 bool positioning_state = 0;
 bool mapping_state = 0;
 
@@ -40,8 +41,10 @@
         //State and Transition Table can be found in the State_Machine.xlsx
         //*******************************************************************************
 
-
-        //printf("state: %d\r\n",state);
+        if(state != old_state){
+            printf("state: %d\r\n",state);
+            old_state = state;
+        }
         switch (state) {
             case 0:
                 state = emergency_shutdown();
@@ -98,7 +101,6 @@
                 break;
             case 36:
                 state = pathfinding();
-                state = 0;
                 break;
             case 37:
                 state = switch_target_red();