michael hollegha
/
BertlPingPong
Bertl Ping Pong Demo Bertl reacts to Buttons. Leds are blinking dependent on current direction
Diff: BertlPingPong.cpp
- Revision:
- 1:81bbec75e875
- Parent:
- 0:2033217d2140
- Child:
- 2:fb6f2a6307d3
diff -r 2033217d2140 -r 81bbec75e875 BertlPingPong.cpp --- a/BertlPingPong.cpp Fri Apr 25 14:38:09 2014 +0000 +++ b/BertlPingPong.cpp Fri Apr 25 19:10:27 2014 +0000 @@ -2,7 +2,7 @@ #include "mbed.h" #include "Serial_HL.h" #include "Bertl14.h" -#include "BertlObjects.h" +#include "BertlObjects.cpp" int gBlinkMode = 1; void BlinkTask(); @@ -15,9 +15,9 @@ pex.ClearLeds(); pex.WaitUntilButtonPressed(); - leds=6; wait(0.8); - pex.WaitUntilButtonPressed(); - leds=0; + leds=6; wait(0.8); + pex.WaitUntilButtonPressed(); + leds=0; stw.start(); while(1) { pex.ReadButtons(); @@ -37,8 +37,9 @@ gBlinkMode=3; pex.ClearLeds(); mL.SetPow(0.9); mR.SetPow(0.9); } + // Blink dependent on value of gBlinkMode BlinkTask(); - wait(0.005); + wait(0.005); } return 1; @@ -58,4 +59,3 @@ if( gBlinkMode==4 ) pex.ToggleLeds(LED_ALL_BACK); } -