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:
- 4:2deeeeb6c1e1
- Parent:
- 3:f686f6d7bdff
- Child:
- 5:5e92567d0a44
diff -r f686f6d7bdff -r 2deeeeb6c1e1 main.cpp
--- a/main.cpp Wed Apr 10 08:00:16 2019 +0000
+++ b/main.cpp Wed Apr 10 21:35:21 2019 +0000
@@ -24,28 +24,32 @@
Gamepad gamepad;
///////////// prototypes ///////////////
-
+void init();
+void welcome();
///////////// functions ////////////////
int main() {
- // initialize the gamepad
- gamepad.init();
- gamepad.leds_on();
- // initialize the lcd
- lcd.init();
- lcd.setContrast(0.4);
+ init();
while(true) {
- // refresh the screen
- lcd.clear();
-
+ welcome();
+ }
+}
- Menu menu;
- menu.startMainMenu(lcd);
-
- // lcd.drawLine(11, 47, 74, 45, 1);
- lcd.refresh();
-
- }
+// initialies all classes and libraries
+void init()
+{
+ // need to initialise LCD and Gamepad
+ lcd.init();
+ gamepad.init();
+
+ gamepad.leds_on();
+ lcd.setContrast(0.4);
+}
+
+void welcome() {
+
+ Menu menu;
+ menu.intro(lcd);
}
\ No newline at end of file