Alexis Deblangy / Mbed 2 deprecated Menu-joystick

Dependencies:   C12832 mbed

Revision:
0:647ac3538c84
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 28 15:55:12 2016 +0000
@@ -0,0 +1,72 @@
+#include "mbed.h"
+#include "C12832.h"
+
+C12832 lcd(D11, D13, D12, D7, D10);
+DigitalIn up (A2);
+DigitalIn left (D4);
+DigitalIn right (A5);
+DigitalIn down (A4);
+int x=0;
+int y=0;
+
+void Page1() {
+        lcd.cls();
+        lcd.locate(10,0);
+        lcd.printf("Matin");
+        lcd.locate(10,10);
+        lcd.printf("Midi");
+        lcd.locate(10,20);
+        lcd.printf("Soir");
+}
+
+void Page2() {
+        lcd.cls();
+        lcd.locate(10,0);
+        lcd.printf("Petit-Dejeuner");
+        lcd.locate(10,10);
+        lcd.printf("Dejeuner");
+        lcd.locate(10,20);
+        lcd.printf("Diner");
+}
+
+int main() {
+    while(1) 
+    {
+        if(x==0 && y==0)
+        {
+            Page1();
+            lcd.locate(0,0);
+            lcd.printf(">");
+        }
+        else if(x==1 && y==0)
+        {
+            Page1();
+            lcd.locate(0,10);
+            lcd.printf(">");
+        }
+        else if(x==2 && y==0)
+        {
+            Page1();
+            lcd.locate(0,20);
+            lcd.printf(">");
+        }
+        else if(x==0 && y==1)
+        {
+            Page1();
+            lcd.locate(0,0);
+            lcd.printf(">");
+        }
+        else if(x==0 && y==1)
+        {
+            Page1();
+            lcd.locate(0,0);
+            lcd.printf(">");
+        }
+        else if(x==0 && y==1)
+        {
+            Page1();
+            lcd.locate(0,0);
+            lcd.printf(">");
+        }
+    }
+}