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 N5110 ShiftReg PinDetect
Diff: MainMenu.cpp
- Revision:
- 1:0cfe2255092a
diff -r 1f92de30d43e -r 0cfe2255092a MainMenu.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MainMenu.cpp Tue Apr 28 12:46:37 2015 +0000
@@ -0,0 +1,39 @@
+#include "MainMenu.h"
+
+MainMenu::MainMenu(N5110 *lcd, PinName buttonA, PinName buttonB, PinName buttonC)
+{
+ this->lcd = lcd;
+
+ btnA = new InterruptIn(buttonA);
+ btnB = new InterruptIn(buttonB);
+ btnC = new InterruptIn(buttonC);
+
+ choice = 0;
+}
+
+MainMenu::~MainMenu()
+{
+ delete btnA;
+ delete btnB;
+ delete btnC;
+}
+
+void MainMenu::nextChoiceISR()
+{
+ choice %= (choice + 1);
+}
+
+void MainMenu::run()
+{
+ // Update
+ //Nothing is done by interrupts
+
+ // Render
+ lcd->printString("Play", 0, 1);
+ lcd->printString("Highscores", 0, 2);
+ lcd->printString("Controls", 0, 3);
+ wait(10);
+
+
+ // Todo: Insert Sleep();
+}
\ No newline at end of file