RGB LED Controller
Toggle the red, green, and blue channels of the onboard RGB LED independently from your browser.
The Arduino sketch advertises a custom GATT service with three one-byte characteristics — one per LED channel. When you connect from this page, the app reads all three characteristics to show the current state, then subscribes to notifications so the switches stay in sync even if the value changes on the board.
Flipping a switch writes a single byte (1 = on, 0 = off) to that channel's characteristic. The sketch picks the write up in its loop, drives the matching LED pin, and echoes the normalized value back as a notification.
The onboard RGB LED is wired active-low: writing LOW to a pin turns that color on. The sketch hides this detail, so the app always works with 1 = on. Because each channel is independent, you can mix colors — red + blue = magenta, all three = white.
Goals
- Flash a BLE sketch that advertises Nano33-RGB
- Connect from Chrome or Edge with Web Bluetooth
- Toggle red, green, and blue channels independently
Materials
- Arduino Nano 33 BLE (or BLE Sense)
- USB cable
- Arduino IDE with ArduinoBLE library