USBHost

Device Control

Allows the communication with USB peripherals like mice, keyboards, and thumbdrives.
The USBHost library allows an Arduino Due board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards. USBHost does not support devices that are connected through USB hubs. This includes some keyboards that have an internal hub.

Go to repository

Compatibility

This library is compatible with the sam architecture so you should be able to use it on the following Arduino boards:

Compatibility Note

Note: while the library is supposed to compile correctly on these architectures, it might require specific hardware features that may be available only on some boards.

Releases

To use this library, open the Library Manager in the Arduino IDE and install it from there.

Usage

Compatible with Arduino Due only

The USBHost library allows an Arduino Due board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards. USBHost does not support devices that are connected through USB hubs. This includes some keyboards that have an internal hub.

NB: The USBHost library and associated functions are experimental. While it is not likely the API will change in future releases, it is still under development.

NB: The USBHost library is distributed under the General Public License version 2 (GPL2) as published by the Free Software Foundation. Any sketch that uses the library needs to be open-sourced under the GPL2 as well.

USBHost Class

USBHost is the base class for all calls that rely on USB host communication. When invoked, it initializes a USB controller. To declare it, use:

USBHost usb;

General

Mouse Controller

`MouseController`

Keyboard Controller