football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
94:831a7fc2d69a
Parent:
93:620dd0a7ddc7
Child:
95:3cc3ae2e5e7f
--- a/main.cpp	Mon Jun 13 02:03:00 2016 +0000
+++ b/main.cpp	Thu Jun 16 03:55:32 2016 +0000
@@ -321,18 +321,33 @@
     uint8_t level = 1, volume = 1;      // SPACE10, VOL_LOW
     int bTeamNew, bTeamOld, bSpaceOld, bSpaceNew, bVMNew, bVLNew, bVMOld, bVLOld;
     
-    // Blink all the space LEDs at startup
-    spaceLEDs(0); wait(0.2); spaceLEDs(1); wait(0.2); spaceLEDs(2); wait(0.2);  spaceLEDs(3); wait(0.2);
-    // ...and go to a single LED
-    spaceLEDs(level);
+    // Blink all the LEDs at startup
+    spaceLEDs(0); wait(0.2); spaceLEDs(1); wait(0.2); spaceLEDs(2); wait(0.2);  spaceLEDs(3); wait(0.2); ledSpace20 = 0;
+#ifdef TEST_LED_SOUND
+    // Test LEDs and sound simultaneously to save time
+    buzzMed = MED_OFF; buzzHigh = HIGH_OFF; 
+    ledBuzzer = 1; buzzer=0; wait(0.2); buzzer=1; ledBuzzer = 0;
+    buzzMed = MED_ON;
+    ledTeamA = 1; buzzer=0; wait(0.2); buzzer=1; ledTeamA = 0;  
+    buzzMed = MED_OFF; buzzHigh = HIGH_ON; 
+    ledTeamB = 1; buzzer=0; wait(0.2); buzzer=1; ledTeamB = 0; 
+    buzzHigh = HIGH_OFF;
+#else
+    ledBuzzer = 1; wait(0.2); ledBuzzer = 0;
+    ledTeamA = 1; wait(0.2); ledTeamA = 0;  
+    ledTeamB = 1; wait(0.2); ledTeamB = 0; 
     
-    // Beep on startup
+    // Beep all the levels on startup
+    beep(NOTE_A5, 0.2, 1);
+    beep(NOTE_A5, 0.2, 2);
+    beep(NOTE_A5, 0.2, 3);
+#endif
+    
+    // ...and go to a informative LEDs
+    spaceLEDs(level);
     ledBuzzer = volume ? 1 : 0;
-    beep(NOTE_A5, 0.5, volume);
-
-    // Turn on the team LED
-    ledTeamA = myTeam & 1;
-    ledTeamB = ~myTeam & 1;
+    if(myTeam & 1) ledTeamA = 1;
+    else ledTeamB = 1;
 
     // Buttons initialization
     buttonSpace.mode(PullDown);