Hugo Hu / Mbed 2 deprecated BRAVEHEART

Dependencies:   mbed N5110 ShiftReg PinDetect

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