Andriy Makukha / Mbed 2 deprecated football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
66:18c214707b0c
Parent:
62:9b34dc1b265d
Child:
67:5650f461722a
diff -r 7addf8506bdb -r 18c214707b0c proto_code.cpp
--- a/proto_code.cpp	Tue Jan 19 03:15:25 2016 +0000
+++ b/proto_code.cpp	Tue Jan 19 07:25:15 2016 +0000
@@ -149,7 +149,7 @@
   
   for(i = 1; i < NUM_CONES + 1; ++i)
   {
-    active_cones[i] = false;
+    active_cones[i] = true; /// false;
   }
     
   unsigned long time = 0;
@@ -321,7 +321,7 @@
         SL_DEBUG("PEN\r\n");
         //serial.printf("Penalty!\n");
         penalty = true;
-        ta.pulse(350,600,~0L,pen_colour);
+        ta.pulse(50,600,~0L,pen_colour);
 ///     ta.post_color(pen_colour);
       }
       else if(timer > ((timeout*3)/4) && !warning)
@@ -329,7 +329,7 @@
         SL_DEBUG("WARN\r\n");
         //serial.printf("Warning!\n");
         warning = true;
-        ta.pulse(350,750,~0L,warn_colour);
+        ta.pulse(50,750,~0L,warn_colour);
 ///     ta.post_color(warn_colour);
       }
       break;
@@ -410,7 +410,9 @@
   fail_quick = mask & FAIL_QUICK;
   timeout = times[index];
   index++;
-  writeToPhone("%d %x %d\r\n", active_cone, mask, timeout);
+
+  if( Dbg )  writeToPhone("%d %x %d\r\n", active_cone, mask, timeout);
+
   writeToPhone("Next cone is %u\r\n", active_cone);  // PROTOCOL
 }
 
@@ -495,7 +497,7 @@
 //     DEBUG("Activate cone ");   // May use this again in future.
 //     DEBUG("%d",active_cone);
 //     DEBUG(" to start.\n");
-     writeToPhone("ACS: %d\r\n", active_cone);
+     if( Dbg )  writeToPhone("ACS: %d\r\n", active_cone);
     }
     
     start = millis();
@@ -737,11 +739,11 @@
     {
         case 'M':
             datastore_set_master();
-            writeToPhone("Power Cycle\r\n");
+            SL_DEBUG("Power Cycle\r\n");
             break;
         case 's':
-            writeToPhone("MS: %d\r\n", datastore_is_master());
-            writeToPhone("RP: %d\r\n", read_params());
+            SL_DEBUG("MS: %d\r\n", datastore_is_master());
+            SL_DEBUG("RP: %d\r\n", read_params());
             break;
     }   
 }
@@ -970,11 +972,12 @@
      resetSensors();
      ta.resetTouch();
      break;
+#ifdef D
     case '5': // DEBUG CODE!
        write_test_pattern();
        datastore_write_patterns();
        break;
-     
+#endif
    case 'z':
     find_cones();
     break;