Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 10:3af708f38a42
- Parent:
- 9:e70179ff61c5
- Child:
- 11:cb48d596aa3e
--- a/main.cpp Tue Apr 24 15:29:17 2018 +0000 +++ b/main.cpp Thu May 03 12:07:54 2018 +0000 @@ -29,7 +29,7 @@ int main() { int fps = 8; // frames per second - + int sleep=0; init(); // initialise welcome(); // display welcome screen till the user press start to start the game @@ -39,10 +39,31 @@ // game loop while (game.get_gameOver1()!=1) { + g_pad.led(1, 0); + g_pad.led(4, 0); + g_pad.led(3, 2); + g_pad.led(6, 2); + game.read_input(g_pad); game.update(g_pad,lcd); render(); wait(1.0f/fps); + + while(g_pad.check_event(Gamepad::BACK_PRESSED) == true || sleep ==1) { + + sleep=1; + ///red leds on , greens are off + g_pad.led(1, 2); + g_pad.led(4, 2); + g_pad.led(3, 0); + g_pad.led(6, 0); + // sleep(); + if(g_pad.check_event(Gamepad::START_PRESSED) == true){ + sleep=0; + break; + } + } + } lcd.clear(); gameOver();