Tomholo ORLOCA
/
DRONE_J1_DUALSHOCK_TEST
Test pour PS2 sur MBED
Revision 0:49ebc8788d0a, committed 2018-01-29
- Comitter:
- potatojuice
- Date:
- Mon Jan 29 16:04:20 2018 +0000
- Commit message:
- Manette PS2 test pour lecture des bouton/g?chette/joystick... Voir biblioth?que
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PS_PAD.lib Mon Jan 29 16:04:20 2018 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/okini3939/code/PS_PAD/#840370e1dcce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jan 29 16:04:20 2018 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include <PS_PAD.h> +DigitalOut myled[] = {LED1, LED2, LED3}; + +PS_PAD DUALSHOCK(D11, D12, D13, D10);//PS_PAD (PinName mosi, PinName miso, PinName sck, PinName cs) +int main() { + DUALSHOCK.init(); + while(1) { + DUALSHOCK.poll(); + myled[0] = DUALSHOCK.read(DUALSHOCK.PAD_CIRCLE); + myled[1] = DUALSHOCK.read(DUALSHOCK.PAD_SQUARE); + myled[2] = DUALSHOCK.read(DUALSHOCK.PAD_TRIANGLE); + //myled[3] = DUALSHOCK.read(DUALSHOCK.PAD_X); + printf("RX=%d RY=%d LX=%d LY=%d\r\n",DUALSHOCK.read(DUALSHOCK.ANALOG_RX),DUALSHOCK.read(DUALSHOCK.ANALOG_RY),DUALSHOCK.read(DUALSHOCK.ANALOG_LX),DUALSHOCK.read(DUALSHOCK.ANALOG_LY)); + wait(0.02); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jan 29 16:04:20 2018 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/794e51388b66 \ No newline at end of file