Testing 6DOF USB HID joystick device.

Dependencies:   USBDevice USBJoystick mbed

Files at this revision

API Documentation at this revision

Comitter:
smartsystemdesign
Date:
Fri Jan 13 08:16:37 2017 +0000
Parent:
2:e9926793544d
Child:
4:dae441214ba4
Commit message:
Looks like the largest HID report size is 64 bytes. I will trim down the features to stay within 64 bytes.

Changed in this revision

USBJoystick.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBJoystick.lib	Fri Jan 13 07:48:38 2017 +0000
+++ b/USBJoystick.lib	Fri Jan 13 08:16:37 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/wim/code/USBJoystick/#1549541d3b4b
+https://developer.mbed.org/users/wim/code/USBJoystick/#f8be03f31e6c
--- 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