Brian Tilton
/
BTilton-Lab2_Joystick_Interupt
Lab2_Part3 working
Fork of Bootcamp-Interrupt_Polling_Joystick by
Revision 3:22fdf3a4be19, committed 2013-10-11
- Comitter:
- Cabal51
- Date:
- Fri Oct 11 04:51:13 2013 +0000
- Parent:
- 2:d18857b99d3c
- Commit message:
- Lab2 Part3 Working
Changed in this revision
C12832_lcd.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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832_lcd.lib Fri Oct 11 04:51:13 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/dreschpe/code/C12832_lcd/#c9afe58d786a
--- a/main.cpp Mon Oct 07 20:14:38 2013 +0000 +++ b/main.cpp Fri Oct 11 04:51:13 2013 +0000 @@ -28,6 +28,9 @@ #endif #include "mbed.h" +#include "C12832_lcd.h" + +C12832_LCD lcd; BusIn joy(p15,p12,p13,p16); InterruptIn fire(p14); @@ -39,8 +42,38 @@ while(1) { if (fire) { leds=0xf; + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rFIRE = ON "); + } else { leds=joy; + + if(joy == 0x8){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rRIGHT = ON "); + } + else if(joy == 0x4){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rLEFT = ON "); + } + else if(joy == 0x2){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rDOWN = ON "); + } + else if(joy == 0x1){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rUP = ON "); + } + else if(joy == 0x0){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("\n\rNONE "); + } } wait(0.1); }