Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Two Joystick HIDs at the Same Time (Teensy ++ 2.0)

  1. #1
    Junior Member
    Join Date
    Dec 2018
    Posts
    3

    Two Joystick HIDs at the Same Time (Teensy ++ 2.0)

    Hello everyone!

    I originally posted this in the project guidance section, but I think this question might be better suited here.

    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. 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.

    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!

  2. #2
    Junior Member
    Join Date
    May 2019
    Posts
    2
    Hi,

    did you have any success regarding this topic meanwhile?

    I am also urgently looking for a solution to drive two HID joystick with Teensy 2.0 ++ :-/

    Thank you,

    Fifsy

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Posts
    1
    Quote Originally Posted by Fifsy View Post
    Hi,

    did you have any success regarding this topic meanwhile?

    I am also urgently looking for a solution to drive two HID joystick with Teensy 2.0 ++ :-/

    Thank you,

    Fifsy
    I am in the same boat here. I have my own (what someone else called) frankenstein controller which registers itself as keyboard and mouse and two analog sticks, and I want to multiplex the inputs into two custom gamepads.
    My idea for the time being, as this issue seems to be unresolved and that I am totally new to all this is, especially micro programmer electronics, so I am trying to gather all needed pieces and might be wrong here.

    a) use a raspberry frontend as usb host to pick up the signals via evdev and then use uart to push the data to teensy where it then is sent as appropriate commands.

    Now my idea is probably to use additional ftdi usb breakouts to open additional serial lines and to use two teensies to achieve that. Both basically run the same code with different conversion tables. But using two teensies seems hackish to me, if there was another way I would prefer it.
    Anyway I am a newby here, and if my idea on this is not correct, feel free to correct me, I would be happy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •