https://github.com/webusb/arduino
This repository contains an Arduino library for WebUSB-enabling your sketches. Example sketches and JavaScript code are available in the demos directory.
WebUSB requires an Arduino model that gives the sketch complete control over the USB hardware. This library has been tested with the following models:
- Arduino Leonardo
- Arduino/Genuino Micro
- Arduino/Genuino Zero
- Arduino MKR1000
- Arduino MKRZero
- Arduino MKRFox1200
- Adafruit Feather 32u4
-
Install at least version 1.8.5 of the Arduino IDE.
-
Install WebUSB/arduino environment by Board Manager of Arduino IDE
Use this package json --> https://kimio-kosaka.github.io/webUSB-arduino/package_webUSB_index.json -
Select WebUSB board
Tools --> Board --> 'Arduino Micro (WebUSB)' or 'Arduino Leonardo (WebUSB)' -
Load up 'rgb' sketch
File --> Examples --> WebUSB --> rgb -
Compile and upload it to your device.
-
When the sketch is finished uploading you should see a notification from Chrome: "Go to https://kimio-kosaka.github.io/webUSB-arduino/index.html to connect." Try it out!
Windows: This notification is currently disabled in Chrome on Windows due to Chromium issue 656702. Implementation of new, more stable USB support for Windows is tracked on Chromium issues 422562 and 637404.