Remodeling Xbox Wireless controller with mbed LPC1768
Fork of XBOX-NHK2015 by
Diff: main.cpp
- Revision:
- 0:a44e054c96e8
diff -r 000000000000 -r a44e054c96e8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 22 08:56:17 2016 +0000 @@ -0,0 +1,61 @@ +#include "mbed.h" +#include "ACM1602NI.h" + + +ACM1602NI lcd(p28,p27); +BusIn XYAB(p5,p6,p7,p8); +BusIn cross(p9,p10,p11,p12); +AnalogIn left(p15); +AnalogIn Right(p17); +AnalogIn RH(p18); +AnalogIn LH(p16); +//JST = Joy Stick TactSW +BusIn JST(p23,p24); +BusIn SB(p29,p30); +BusIn other(p21,p22); +AnalogIn LT(p20); +AnalogIn RT(p19); +DigitalOut led(p26); +DigitalOut led2(p25); +Serial con(p13,p14); + +int main() { + XYAB.mode(PullUp); + other.mode(PullUp); + SB.mode(PullUp); + JST.mode(PullUp); + cross.mode(PullUp); + uint8_t i,n,m,p,q; + double z,x,c,v,g,j; + + char data=0,check=255; + + //lcd.printf("Start\n"); + //wait(2); + + while(1) { + i = XYAB; + n = cross; + m = JST; + p = SB; + q = other; + + z = left; + x = Right; + c = LT; + v = RT; + g = RH; + j = LH; + + led = 1; + led2 = 1; + + data=p; + + con.putc(check); + con.putc(data); + + + printf("%d-%d-%d-%d-%d--%lf-%lf-%lf-%lf-%lf-%lf\r\n",i,n,m,p,q,z,x,c,v,j,g); + } +}