Arduino zero Joystick / Arduino zero HID / Arduino zero USB

No, I uploaded the sketches to my board and then used the Windows "Game Controllers" utility to verify that the sketch was producing a game controller device and that the axis movements and button press behaviors of the game controller device were as expected for the sketch.

I also ran into this, but was hoping you would not. The problem is with the Windows drivers. For some reason the inappropriate "usbser" driver is installed for the board. The driver we need is the Windows built-in "HidUsb" driver.

Please try this:

  1. Connect the Zero board to your computer with the USB cable.
  2. Open the Windows Device Manager.
  3. Select View > Devices by type from the Device Manager menus.
  4. Open the "View" menu.
  5. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  6. Find the problematic device in the Device Manager tree (it will probably be under "Ports (COM & LPT)" section).
    :warning: The Zero will produce two devices. One of these is a functional USB CDC serial port. Make sure to select the other device.
  7. Right click on the problematic device.
    A context menu will open.
  8. Select "Uninstall device" from the menu.
    The "Uninstall Device" dialog will open.
  9. Check the "Attempt to remove the driver for this device" checkbox.
  10. Click the "Uninstall" button.
    The dialog will close.
  11. Disconnect the USB cable of the Zero board from your computer.
  12. Connect the Zero board to your computer with the USB cable.
  13. Wait to see if the problematic device appears once again. If so, repeat steps 6-13 again until the problematic device no longer appears.
    I believe it is necessary to do this multiple times in cases where multiple installations of the "usbser" driver have been made for the device.

After doing that, the Zero should now be recognized as a game controller.

I only tried the Gamepad example. For keyboard emulation I recommend using the official "Keyboard" library, which is installed as part of the Arduino IDE installation:

https://docs.arduino.cc/language-reference/en/functions/usb/Keyboard/

You will find a collection of example sketches that demonstrates the use of the library under the File > Examples > 09.USB > Keyboard menu in Arduino IDE.

I encountered the same problem with the keyboard emulation as we did with the game controller emulation:

Uninstalling the driver also solved that problem.

As I said above, I did. I didn't do testing beyond a quick check of the basic functionality though.

1 Like