1

This question already has an answer here:

I have an Arduino Uno and A Raspberry Pi B+. I was wandering how I could use either as a Programbel HID Device (EX: https://srlabs.de/badusb/). The Reason I ask under the arduino section is I want to preferably use it. If not I can use either.

marked as duplicate by Chris Stratton, Mattia, Paul, Nick Gammon Apr 16 '16 at 9:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The Arduino question has already been asked and answered. As for the pi, it is theoretically possible with a model A or zero to operate the USB as a device rather than host, though I'm not sure anyone has ever done so. But with models such as the B+ having multiple USB connectors, an onboard USB hub gets in the way of operating in device mode. – Chris Stratton Apr 14 '16 at 14:20
-1

The Uno cannot be used as a HID device through the on board USB. You might be able to use the V-USB Library to be a HID device using the digital IO pins. See this tutorial.

There are several arduino compatible boards that do can act as a HID device natively. Most boards built around the ATMega32u4 can be a HID device. For example the Arduino Micro

See this question about the Raspberry Pi.

  • 2
    I would share our experience with V-USB. For educational purposes, we had the opportunity to use like 15+ Arduinos with V-USB (Adafruit Trinket). At the moment, only two of them works well. There are various issues with newer motherboards, Windows 10, and mystic enumeration problems. I strongly recommend going for 32u4, such as Arduuno Leonardo or Arduino Micro (or any similar product with 32u4) – Gee Bee Apr 13 '16 at 18:42
  • This answer is not correct in saying that it is not possible with the stock hardware. The Uno's USB interface is provided by a reprogrammable ATmega8u2 or 16u2, and there are writeups online of how to program that to be an HID device. Granted, there is the subsequent difficulty of the USB-serial channel not then being available to program the Arduino, though a dual-mode firmware is conceivably possible, if perhaps challenging to use with OSX hosts. – Chris Stratton Apr 14 '16 at 14:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.