These instructions cover firmware builds for macOS, Linux, and Windows, plus static hosting of the WebUSB app through GitHub Pages.
Hardware:
Software:
arduino-clibrew install arduino-cli
Use your package manager if it ships a recent arduino-cli, or download the release archive from Arduino and place arduino-cli on PATH.
Install the official Arduino CLI zip or MSI, then ensure arduino-cli.exe is on PATH.
Run once on any platform:
arduino-cli config init
arduino-cli core update-index
arduino-cli core install adafruit:nrf52
If your CLI config does not already include the Adafruit package index, add it first:
board_manager:
additional_urls:
- https://www.adafruit.com/package_adafruit_index.json
Then rerun arduino-cli core update-index.
From the repository root:
arduino-cli compile \
-b adafruit:nrf52:feather52840 \
--build-property "build.extra_flags=-DNRF52840_XXAA {build.flags.usb} -DCFG_TUD_HID=4" \
.
This sketch requires CFG_TUD_HID=4 because Steam mode exposes four HID interfaces.
Find the board port:
arduino-cli board list
Upload:
arduino-cli upload \
-b adafruit:nrf52:feather52840 \
-p /dev/ttyACM0 \
.
Replace /dev/ttyACM0 with the actual port. On macOS it is usually /dev/cu.usbmodem*.
Find the COM port:
arduino-cli board list
Upload:
arduino-cli upload `
-b adafruit:nrf52:feather52840 `
-p COM5 `
.
Replace COM5 with the actual board port.
0xB4 = 0x02 when connected.WebUSB requires a secure context. http://localhost qualifies.
cd docs
python3 -m http.server 8008
Open:
http://localhost:8008
cd docs
py -m http.server 8008
Open:
http://localhost:8008