USB HID Joystick Example (modified USBMouse)
Dependencies: mbed
Revision 2:5d414d475e02, committed 2020-10-22
- Comitter:
- bouaziz
- Date:
- Thu Oct 22 19:03:23 2020 +0000
- Parent:
- 1:ec6deffecbd3
- Commit message:
- test joystick
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Jan 19 11:27:13 2011 +0000 +++ b/main.cpp Thu Oct 22 19:03:23 2020 +0000 @@ -15,7 +15,7 @@ AnalogIn analog_rz(p20); // PS3: Right Analog Stick Y-axis BusIn stick( - p21, p22, p23, p24 // PS3: Up, Down, Left, Right + p15, p12, p13, p16 // PS3: Up, Down, Left, Right ); USBJoystick joystick; @@ -27,7 +27,7 @@ signed char z = (analog_z.read_u16() >> 8) - 0x80; signed char rz = (analog_rz.read_u16() >> 8) - 0x80; - joystick.joystick(stick.read(), buttons.read(), x, y, z, rz); + joystick.joystick(0,stick.read() , x, y, z, rz); led = (buttons > 0 || stick > 0) ? 1 : 0;