ECE4180 / Mbed 2 deprecated joystick

Dependencies:   4DGL-uLCD-SE mbed

Files at this revision

API Documentation at this revision

Comitter:
ldeng31
Date:
Tue Oct 06 19:22:53 2015 +0000
Commit message:
Five ways Joystick.

Changed in this revision

4DGL-uLCD-SE.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
diff -r 000000000000 -r a049d7ebbaed 4DGL-uLCD-SE.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/4DGL-uLCD-SE.lib	Tue Oct 06 19:22:53 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/4180_1/code/4DGL-uLCD-SE/#e39a44de229a
diff -r 000000000000 -r a049d7ebbaed main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 06 19:22:53 2015 +0000
@@ -0,0 +1,68 @@
+#include "mbed.h"
+#include "uLCD_4DGL.h"
+
+
+uLCD_4DGL myLCD(p9, p10, p11);
+
+DigitalIn Right(p15);
+DigitalIn Down(p16);
+DigitalIn Left(p17);
+DigitalIn Center(p19);
+DigitalIn Up(p20);
+
+int main() {
+    while(1) {
+        if(Right == 0)
+        {
+        myLCD.cls();
+        myLCD.circle(64, 64, 63, WHITE);
+        myLCD.locate(1,6);
+        myLCD.text_width(3); //4X size text
+        myLCD.text_height(3);
+        myLCD.color(RED);
+        myLCD.printf("Right");
+        wait(1.0);
+        }
+        else if(Down == 0)
+        {
+        myLCD.cls();
+        myLCD.circle(64,64,63,GREEN);
+        myLCD.locate(2,6);
+        myLCD.text_width(3);
+        myLCD.text_height(3);
+        myLCD.printf("Down");
+        wait(1.0);
+        }
+        else if(Left == 0)
+        {
+        myLCD.cls();
+        myLCD.circle(64,64,63,RED);
+        myLCD.locate(2,6);
+        myLCD.text_width(3);
+        myLCD.text_height(3);
+        myLCD.printf("Left");
+        wait(1.0);
+        }
+        else if(Center == 0)
+        {
+        myLCD.cls();
+        myLCD.circle(64,64,63,BLUE);
+        myLCD.locate(0,6);
+        myLCD.text_width(3);
+        myLCD.text_height(3);
+        myLCD.printf("Center");
+        wait(1.0);
+        }
+        else if(Up == 0)
+        {
+        myLCD.cls();
+        myLCD.circle(64,64,63,LGREY);
+        myLCD.locate(6,6);
+        myLCD.text_width(3);
+        myLCD.text_height(3);
+        myLCD.printf("Up");
+        wait(1.0);
+        }
+        
+    }
+}
diff -r 000000000000 -r a049d7ebbaed mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 06 19:22:53 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file