An example program for the mbed application board that uses the joystick button. LED1,2,3,4 light in sequence with up, down, left, right, and pushing the button lights them all. Note that the orientation is looking at the screen in landscape,with the row of connectors at the bottom

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Mon Oct 15 13:37:36 2012 +0000
Commit message:
First commit

Changed in this revision

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/main.cpp	Mon Oct 15 13:37:36 2012 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+BusIn joy(p15,p12,p13,p16);
+DigitalIn fire(p14);
+
+BusOut leds(LED1,LED2,LED3,LED4);
+
+int main()
+{
+    while(1) {
+        if (fire) {
+            leds=0xf;
+        } else {
+            leds=joy;
+        }
+        wait(0.1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 15 13:37:36 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc
\ No newline at end of file