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.
Diff: main.cpp
- Revision:
- 6:952ac12c7f00
- Parent:
- 5:7e8f5fad7b6b
- Child:
- 7:6eb9cade57ab
--- a/main.cpp Sat Apr 06 15:19:56 2019 +0000 +++ b/main.cpp Sun Apr 07 10:36:53 2019 +0000 @@ -12,18 +12,19 @@ #include "mbed.h" #include "N5110.h" -Gamepad device(); +Gamepad gamepad; N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); -void startmenu(); +bool startmenu(); int main(){ - /*device.init();*/ + gamepad.init(); lcd.init(); wait(1); - startmenu(); + bool cont = startmenu(); + } -void startmenu() { +bool startmenu() { lcd.clear(); char gamename[] = {'L', 'A', 'B', 'Y', 'R', 'I', 'N', 'T', 'H', ' ', ' ', '\0'}; int i = 0; @@ -38,5 +39,15 @@ } lcd.printString("Press start", 9, 4); lcd.printString("to play >", 15, 5); - + lcd.refresh(); + bool advance = false; + while (!advance){ + if (gamepad.check_event(gamepad.START_PRESSED)){ + lcd.clear(); + lcd.refresh(); + advance = true; + } + else { advance = false; } + } + return advance; }