My experiments with WebUSB API. Ported age old snake game to run on Arduino board controlled from the web using WebUSB APIs.
Web app is available under web
folder. This folder contains static html and JS files. Start any local server to serve these contents. Update sketch file with the port number and scheme (HTTPS-1, HTTP-0)
Sketch is available under sketch
folder. This project depends on WebUSB library. Follow this getting started guide to download and prepare the library. Upload the sketch to Arduino. Once the sketch is uploaded, Chrome will show a pop-up with the web page URL. Go to the web page to connect to the Arduino board.
- Arduino Leonardo (You can use other compatible boards as well)
- TFT LCD screen
WebUSB API is currently available in Chrome only. Tested in Chrome 62.
The source code is available here under MIT licence. Feel free to use any part of the code. Please send any bugs, feedback, complaints, patches to me at varunkumar[dot]n[at]gmail[dot]com.
-- Varun