![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Joystick2
Dependencies: mbed
Fork of FTKL_board-Joystick2 by
FTKL_board-Joystick2.cpp
- Committer:
- Planinsec
- Date:
- 2015-04-29
- Revision:
- 0:1ee1d2b34ead
File content as of revision 0:1ee1d2b34ead:
#include "mbed.h" BusIn biJoy(p15,p12,p13,p16); DigitalIn diFire(p14); BusOut doLeds(LED1,LED2,LED3,LED4); int main() { doLeds=0; while(1) { if (diFire) { doLeds=0; } if (biJoy==1) { while (1) { doLeds=doLeds<<1; if (doLeds==16 ||doLeds== 0) { doLeds=1; } if (diFire) { doLeds=0; break; } wait(0.5); } } if (biJoy==2) { while(1) { doLeds=doLeds>>1; if (doLeds==16||doLeds==0) { doLeds=8; } if (diFire) { doLeds=0; break; } wait(0.5); } } } //while 1 } //main