Testing 6DOF USB HID joystick device.
Dependencies: USBDevice USBJoystick mbed
Diff: main.cpp
- Revision:
- 3:9b51b991e5d6
- Parent:
- 2:e9926793544d
- Child:
- 4:dae441214ba4
--- a/main.cpp Fri Jan 13 07:48:38 2017 +0000
+++ b/main.cpp Fri Jan 13 08:16:37 2017 +0000
@@ -121,7 +121,7 @@
#endif
i++;
-// joystick.move(joyXin, joyYin, joyZin, joyRxin, joyRyin, joyRzin);
+// joystick.move(joyXin.read_u16(), joyYin.read_u16(), joyZin.read_u16(), joyRxin.read_u16(), joyRyin.read_u16(), joyRzin.read_u16());
x = map(joyXin.read_u16(), 0, 65535, -32768, 32768); // value -32768 .. 32767
y = map(joyYin.read_u16(), 0, 65535, -32768, 32768);
@@ -134,7 +134,7 @@
pc.printf(" %d %d %d %d %d %d\r\n", x, y, z, rx, ry, rz);
- joystick.update(x, y, z, rx, ry, rz, buttons, hat);
+// joystick.update(x, y, z, rx, ry, rz, buttons, hat);
wait(0.005);
}
}
\ No newline at end of file