Dual Joystick HID on Teensy ++ 2.0

Status
Not open for further replies.

Zer0

New member
Hello everyone!

For the past couple of days I have been trying to write code to allow me to display two Joystick HID interfaces at once. (Having two separate HIDs in device manager and game controllers)

My objective is to connect two retro controllers to the Teensy and have them appear as their own gamepad interface in windows/mac/linux. I have found this repository that has managed to do what I intend https://github.com/jjstreet/teensyarcade but it uses the old version of Teensyduino, because of that, i'm limited to 8 buttons and 2 axis, and most of the new Joystick commands from version 1.45 are unavailable. I would like to ultimately make N64 and Gamecube controllers work as well, so I'd need 4 axis and 10 buttons + 4 for DPad.

I approached this problem in two ways: First I tried adding buttons and axis to the code I provided in the above link, but after hours of trying, even if I did manage to modify the USB.C file and other core files, I couldn't get the controller to work correctly or at all.

My second approach was to take the code as an inspiration and try to implement dual Joystick HIDs using the new version of Teensyduino and Arduino IDE, which supports 32 buttons 6 axis and one multi directional HAT switch. Once again, after hours of attempting to get the code to compile, it wouldn't stop spitting out errors, once i modified the USB.c file to have dual Joystick interfaces, the USB_API.cpp file wouldn't recognize the needed variables to compile the code.

Do you guys have any suggestions? or know of any other project that has done this same thing? I'm willing to start from scratch.

Thanks in advance!
 
I managed to fix some of the compiler errors on my attempt to try and replicate the multiple HID joystick code on the newest version of the Teensy IDE. The Joysticks still don't appear in the device manager, it may be that I have the wrong usb hid device descriptors, or that my USB_API.cpp is wrong.

Here's the code if anyone would like to take a look.
 
Status
Not open for further replies.
Back
Top