Author Options:

How do you use the Arduino USB_host library? Answered

I want to read the data from a usb midi keyboard (Korg microKey) on my Arduino (Arduino Mega ADK), but I cannot find any tutorials on how to use the USB_host library for this kind of application. There are also no tutorials that explain how the USB_host library works, so I cannot work out the code for myself. An example of what I wan to do can be found here: https://www.youtube.com/watch?v=kfCDjwHBBuM. However, he does not explain how he does it, or how how to adapt his code for other devices.

Discussions

I finally found something about adapting the USB_host library for your own devices: http://www.circuitsathome.com/mcu/hid-joystick-code-sample. However, my Arduino Mega ADK does not seem to power any devices, like mice, keyboards or my Korg microKey - Even using their example programs. Is it the the Arduino or the code that is responsible for this not working?

Then you need to familiarize yourself with coding. Start on more simple example codes offered on the Arduino web site to get better familiar with the code. With a better understanding your start to see how you can adapt the code to your needs. Also check the Forums at the Arduino Site. You'll likely find discusions about using the host library there.

I have experience using the Arduino programming language and using/adapting external libraries. However, the USB_host library is more complex and, as I have mentioned above, there is very little documentation on using it.

I have checked the Arduino forums and i cannot find any posts on using or applying the USB_host library.

I am using the "USB Host Library for Arduino" hosted by Lauzus from circuits@home on GitHub. So far I have only been able to use the examples provided because there is no documentation on how to adapt these for other usb devices.