RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Arduino Leonardo/Micro with two emulated devices (one usb port) seen as one (js0)

    Scheduled Pinned Locked Moved Help and Support
    joystickarduinoleonardomicrojs0
    2 Posts 1 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanikD
      Danik
      last edited by

      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?

      DanikD 1 Reply Last reply Reply Quote 0
      • DanikD
        Danik @Danik
        last edited by

        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!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.