Get X/Y Axis with custom gamepad and Teensy 3.2

Status
Not open for further replies.
I am currently using my Teensy 3.2 as a USB game controller driver. I have gotten all the button presses to work but cant figure out how to program the dpad or joystick? Im using a 4 switch type dpad.

Any help would be much appreciated.
 
Teensy as gamepad (with proper dpad support) ?

Hi, I'm new here and am also wondering about gamepads and their dpad.
So, @toberryhunter, did you figure out how to use your Teensy as a proper gamepad?

I did some investigations on my own and if I'm not mistaken, this is the current situation:
- Standard USB HID devices describe themselves via device descriptors. (See usb_desc.c)
- Teensy(duino) implements a "Joystick" (0x09, 0x05 "USAGE (Joystick)") but in the USB specs this is different from a gamepad (0x09, 0x04 "USAGE Game Pad").
- A "dpad" is typically associated with a gamepad and not a joystick; the Teensy provides analog axes and buttons, but not a digital directional pad. It may be possible to have the analog X Y axes send only full left, full right, etc., but the OS would probably not autodetect those axes as a dpad. So no plug & play.
- In order to use the Teensy as a proper USB gamepad, a new type including a gamepad endpoint needs to be implemented in usb_desc.{c,h}. This could be based on code from other projects: bbyam/teensysimplegamepad , AlanChatham/UnoJoy
- In order for this new type to show up in the Arduino IDE, boards.txt must be edited. (More details here)

It'd be very helpful if somebody could confirm some or all of the above. :)
I've got some experience with Arduino, AVR, ESP8266, PlatformIO, etc. but not so much with USB HID and modifying core code. I may just as well end up hacking the PCB of a cheap SNES-controller clone...
 
Status
Not open for further replies.
Back
Top