ELEC2645 (2018/19) / Mbed 2 deprecated el17dtt

Dependencies:   mbed

Revision:
1:3183193cf44e
Parent:
0:a0dedca5e89f
Child:
3:f686f6d7bdff
--- a/main.cpp	Tue Mar 12 09:38:02 2019 +0000
+++ b/main.cpp	Sun Mar 31 22:49:44 2019 +0000
@@ -1,5 +1,9 @@
 
 #include "mbed.h"
+#include "Gamepad.h"
+#include "N5110.h"
+#include "menu.h"
+
 
 /*
 ELEC2645 Embedded Systems Project
@@ -11,10 +15,32 @@
 Date: 12.03.2019
 */
 
-Serial pc(USBTX, USBRX); // tx, rx
+// consytucting the gamepad
+Gamepad gamepad;
+
+// constructing the lcd 
+N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 
 int main() {
+    // initialize the gamepad
+    gamepad.init();
+    gamepad.leds_on();
     
-    pc.printf("Hello World!\n");
-       
+    // initialize the lcd
+    lcd.init();
+    lcd.setContrast(0.4);
+    
+    while(true) {
+           // refresh the screen
+            lcd.clear();
+            
+            // draw the big circle
+            //lcd.drawCircle(42,64,35,FILL_TRANSPARENT);
+            Menu menu;
+            menu.startMainMenu(lcd);
+            
+            // lcd.drawLine(11, 47, 74, 45, 1);
+            lcd.refresh();
+            
+    }
 }
\ No newline at end of file