This project uses a 16-key RGB keypad (Keybow/Pimoroni RGBKeypad) powered by CircuitPython to act as a media controller, keyboard macro pad, and animated LED visualizer. It also includes a built-in web server hosted on the device for static file serving.
-
Media Keys: Volume, mute, play/pause, track navigation.
-
Keyboard Macros: Predefined key combinations like
Ctrl + C
,Ctrl + V
. -
Visual Modes:
- Rainbow Mode: Shimmering rainbow effect on the keypad.
- Snake Mode: Moving snake animation across the keys.
- Music Mode: Animated bars with rainbow gradient (not actually audio-reactive).
-
Mode Switching: Dedicated key to cycle through display modes.
-
Web Server: Hosts static content (
index.html
) accessible via Wi-Fi.
- Pimoroni Pico RGB Keypad Base)
- CircuitPython-compatible microcontroller
- Wi-Fi capable board (e.g. Raspberry Pi Pico W, ESP32-S2/S3, etc.)
Install the following CircuitPython libraries on your device:
adafruit_hid
adafruit_requests
adafruit_httpserver
adafruit_connection_manager
pmk
(Pimoroni Keybow library)usb_hid
- Standard
os
,math
,random
,time
project_root/
β
βββ code.py # Main application logic
βββ /static/index.html
β βββ index.html # Web page served by the board
βββ /lib # All required CircuitPython libraries
β βββ adafruit_*.mpy
β βββ pmk/
-
Copy Code & Files Flash your board with CircuitPython, then drag
code.py
and all necessary libraries to the root of the CIRCUITPY drive. Create a folder namedstatic
and write anindex.html
file - that will automatically served. -
Configure Wi-Fi Set environment variables on the board (e.g. using
secrets.py
or.env
) for:CIRCUITPY_WIFI_SSID="YourNetwork" CIRCUITPY_WIFI_PASSWORD="YourPassword" CIRCUITPY_WEB_API_PORT=80
-
Connect & Run On boot, the keypad will connect to Wi-Fi and start serving
index.html
. Open your browser to the IP printed in the REPL/log.
The keypad supports the following actions:
Key Index | Function |
---|---|
0 | Volume Down |
1 | Mute |
2 | Volume Up |
3 | Play/Pause |
4 | Previous Track |
5 | Next Track |
12 | Ctrl + C |
13 | Ctrl + V |
15 | Switch Visual Mode (cycle modes) |
- RAINBOW_MODE: Continuous color gradient shift.
- SNAKE_MODE: 3-segment snake slithering through a pre-defined path.
- MUSIC_MODE: Random height bars with color animation (visual only).
- DISPLAY_OFF: Turns off all LEDs.
Use the mode-switching key to cycle through them.
Uses adafruit_httpserver
to serve a static index.html
. This allows for:
- Hosting a configuration page
- Serving JSON APIs or interacting with the keypad remotely
- Plug in your keypad controller board via USB.
- The device will automatically start the server and show animations.
- Press key 15 to toggle between visual modes.
- Access the web interface by visiting the printed IP address in your browser.
- This project does not actually sync to real audio in music modeβitβs a visual simulation.
- Customize the key actions or LED behavior by editing the
layer
dictionary or mode functions.
This project is open-source under the MIT License. Modify and share freely!