Alexis Deblangy / Mbed 2 deprecated Menu-joystick

Dependencies:   C12832 mbed

Files at this revision

API Documentation at this revision

Comitter:
Sangura
Date:
Wed Sep 28 15:55:12 2016 +0000
Commit message:
Coucou

Changed in this revision

C12832.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Wed Sep 28 15:55:12 2016 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/chris/code/C12832/#7de323fa46fe
--- /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(">");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 28 15:55:12 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file