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

Committer:
chris
Date:
Mon Oct 15 13:37:36 2012 +0000
Revision:
0:0e4db18afd77
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris 0:0e4db18afd77 1 #include "mbed.h"
chris 0:0e4db18afd77 2
chris 0:0e4db18afd77 3 BusIn joy(p15,p12,p13,p16);
chris 0:0e4db18afd77 4 DigitalIn fire(p14);
chris 0:0e4db18afd77 5
chris 0:0e4db18afd77 6 BusOut leds(LED1,LED2,LED3,LED4);
chris 0:0e4db18afd77 7
chris 0:0e4db18afd77 8 int main()
chris 0:0e4db18afd77 9 {
chris 0:0e4db18afd77 10 while(1) {
chris 0:0e4db18afd77 11 if (fire) {
chris 0:0e4db18afd77 12 leds=0xf;
chris 0:0e4db18afd77 13 } else {
chris 0:0e4db18afd77 14 leds=joy;
chris 0:0e4db18afd77 15 }
chris 0:0e4db18afd77 16 wait(0.1);
chris 0:0e4db18afd77 17 }
chris 0:0e4db18afd77 18 }