Arduino - USBHost

Arduino

Reference Language | Libraries | Comparison | Changes

## USBHost

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
- Task()

#### Mouse Controller

The MouseController library enables communication between a connected USB mouse and the Due.

- MouseController

- mouseMoved()
- mouseDragged()
- mousePressed()
- mouseReleased()

- getXChange()
- getYChange()
- getButton()

#### Keyboard Controller

The KeyboardController library enables communication with a connected USB keyboard.

Keyboards that connect through an internal USB hub will not work. This includes most Apple keyboards that have been tested.

- KeyboardController

- keyPressed()
- keyReleased()

- getModifiers()
- getKey()
- getOemKey()

#### Examples

- MouseController: Demonstrates the MouseController commands in one program.
- KeyboardController: Demonstrates the KeyboardController commands in one program.

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

### Share

### This link has expired.
Please re-subscribe to our Newsletters.

### Subscribe to our Newsletters

Email

Please enter a valid email to subscribe

Arduino Newsletter
Arduino Store Newsletter

### Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy

###### Newsletter

- ©2015 Arduino
- Copyright Notice
- Contact us
- About us
- Careers