20151026 リセット追加
Dependencies: FatFileSystem mbed
Fork of PS3_BlueUSB by
Diff: TestShell.cpp
- Revision:
- 2:98fc1e2f13f4
- Parent:
- 1:7b5dfa9668df
- Child:
- 3:8733d7b59027
diff -r 7b5dfa9668df -r 98fc1e2f13f4 TestShell.cpp --- a/TestShell.cpp Wed Jun 17 09:48:19 2015 +0000 +++ b/TestShell.cpp Sat Oct 17 06:29:43 2015 +0000 @@ -1,4 +1,3 @@ - /* Copyright (c) 2010 Peter Barrett @@ -38,7 +37,8 @@ DigitalOut LEDa(LED1); PwmOut LEDb(LED2); PwmOut LEDc(LED3); -Serial Dev(p13,p14); +Serial Dev(p28,p27); +BusIn LB(p24,p23,p22,p21); void printf(const BD_ADDR* addr) @@ -167,17 +167,18 @@ { u16 ButtonState = ((ps3report*)(data + 1))->ButtonState; - u8 x = (ButtonState&0xff00)>>8, x1 = ButtonState & 0xff ; + u8 x = (ButtonState&0xff00)>>8, x1 = (ButtonState & 0xff); DATA[0] = x ; - DATA[1] = x1; + DATA[1] = LB; DATA[2] = ((ps3report*)(data+1))->LeftStickX; DATA[3] = ((ps3report*)(data+1))->LeftStickY; DATA[4] = ((ps3report*)(data+1))->RightStickX; DATA[5] = ((ps3report*)(data+1))->RightStickY; - DATA[6] = ((ps3report*)(data+1))->PressureUp; + DATA[6]=x1; + //DATA[6] = ((ps3report*)(data+1))->PressureUp; DATA[7] = ((ps3report*)(data+1))->PressureRight; DATA[8] = ((ps3report*)(data+1))->PressureDown; - DATA[9] = ((ps3report*)(data+1))->PressureLeft; + DATA[9] = ((ps3report*)(data+1))->PressureLeft; DATA[10] = ((ps3report*)(data+1))->PressureL2; DATA[11] = ((ps3report*)(data+1))->PressureR2; DATA[12] = ((ps3report*)(data+1))->PressureL1; @@ -200,7 +201,9 @@ DATA[29] = ((ps3report*)(data+1))->Connection; //Dev.putc(0xff); //wait(0.003); - for(int i = 0;i<6;i++) + Dev.putc(114); + wait(0.0003); + for(int i = 0;i<7;i++) { //if(i%2 == 1) wait(0.0003);