Arduino Leonardo/Micro with two emulated devices (one usb port) seen as one (js0)
-
Hello!
I added two db-9 ports and wrote a simplistic sketch that emulates two Joystick HID Devices in Arduino Micro.
Each emulated joystick has 2 axes and 2 buttons, but RetroPie (or even Linux in general, for that matter) creates a js0 device under /dev/input that has 2 axes and 4 buttons. Button 1 and 2 of the first joystick are buttons 0 and 1 respectively and Button 1 and 2 of the second joystick are buttons 2 and 3 on this js0 device. The axes are working simultaneously (that is to say both the first and second emulated joystick d-pads control the js0 axes simultaneously).In other words, the two devices are merged into one! It works perfectly under windows and it appears as two devices with 2 axes and 2 buttons each. What should be happening is I should get two devices, js0 and js1 with 2 axes and 2 buttons each.
Can I somehow work around this?
-
http://mheironimus.blogspot.gr/2015/09/linux-support-for-arduino-leonardo.html
Solution Found! For anyone else having problems with Leonardo/Micro problems, it's just a matter of adding a string to the end of the line in /boot/cmdline.txt depending on your setup:
usbhid.quirks=0x2341:0x8036:0x040 (for Leonardo)
usbhid.quirks=0x2341:0x8037:0x040 (for Micro)Yay!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.