Welcome to Raspberry Pi 5 repository
2. RGB Strip
OpenClaw RGB Strip Control Tutorial
Before starting, please complete [01-Peripheral Hardware Configuration], [02-OpenClaw API-KEY Configuration], [03-OpenClaw Model Switching], [04-AI Voice Interaction Configuration], and [05-Three Dialogue Configuration Tests] in the
Preparation Before Usedirectory. If you are only using TUI/WhatsApp, you can skip04. This article assumes the basic environment is ready and only covers RGB-related content.
1. Tutorial Objectives
This article demonstrates OpenClaw's natural language control capability through RGB light peripherals. After completing this tutorial, readers will be able to:
- Understand the basic approach to controlling RGB lights with OpenClaw
- Communicate with OpenClaw via WhatsApp, TUI, and voice commands
- Complete four RGB cases: solid color lighting, breathing light, warning flash, rainbow marquee
- Understand the complete chain from "user input" to "light execution"
2. Hardware Preparation
- OpenClaw main control board
- RGB light strip / RGB LED module
[default 14 WS2812 LEDs] [Optional] Microphone module- Wiring diagram

Here you can add RGB wiring diagrams and hardware photos yourself.
3. Software Preparation
Code entry points used in this tutorial:
- Low-level driver code:
/home/pi/hardware_hal_demo/ - RGB control command:
/home/pi/hardware_hal_demo/rgb - Voice entry:
/home/pi/voice_to_openclaw/src/main.py
The rgb tool already supports the following capabilities:
- Set fixed color
color - Set light effect
effect - Turn off lights
off
Currently commonly used light effects include:
breathebreathing lightblinkflashflowflowing lightmarqueemarqueerainbowrainbow light
If you want to verify the low-level RGB commands individually, you can also type the following in the terminal:
rgb color --color red #All turn redrgb effect --effect breathe --color blue --speed 5 #Breathing lightrgb off #Turn off lightsFor more commands, see the md document in this folder:
xxxxxxxxxx/home/pi/hardware_hal_demo/README.mdIf the low-level commands execute normally, it means the hardware and Raspberry Pi board are properly connected with normal communication.
4. Testing RGB Strip
Before starting this tutorial, please complete an openclaw tui basic conversation self-check first; if you haven't done this yet, see [05-Three Dialogue Configuration Tests]. After confirming OpenClaw can respond normally, proceed with the RGB-specific test.
Enter TUI by typing the following in the terminal:
xxxxxxxxxxopenclaw tui
You can try the following in the terminal:
- Set all RGB lights to red
- Change RGB lights to blue
- Lower the RGB light brightness
- Turn off RGB lights

If you want to test a specific LED, you can try typing something like:
- Set LED 1 to green
- Set LED 5 to purple
5. Three Ways to Communicate with OpenClaw
| Method | Suitable Scenario | Advantages | Suggested Use |
|---|---|---|---|
| Remote control, classroom demonstration | Easy to connect, suitable for multi-person experience | Demonstrate "remote natural language control" | |
| TUI | Local debugging, command verification | Most direct, easiest to troubleshoot | First to get the control link working |
| Voice Code | Voice interaction, complete AI experience | Closest to real conversation experience | As the final demonstration solution |
If you have the optional AI voice module + speaker, the TUI and WhatsApp conversations need to broadcast OpenClaw's replies. You can run the following program in the terminal. This is not needed for AI voice module conversations.
- Modify the TTS enable parameter
xxxxxxxxxx/home/pi/voice_to_openclaw/.env
xxxxxxxxxxENABLE_TTS=true # This parameter controls whether to broadcast replies. After saving, run the program below in the terminal.- Terminal input
xxxxxxxxxxcd ~/voice_to_openclawsource .venv/bin/activatepython -m src.openclaw_session_tts
5.1 WhatsApp Solution
For WhatsApp integration steps, please refer directly to [05-Three Dialogue Configuration Tests]. This section only includes dialogue examples suitable for the RGB tutorial.
After creating, you can converse directly, for example:
- Make the light strip blue
- Turn on rainbow light effect
- Make the lights flash faster

5.2 TUI Solution
If you have already completed the TUI self-check from chapter 0, simply type the following command in the terminal to continue the conversation:
xxxxxxxxxxopenclaw tui
5.3 Voice Code Solution
xxxxxxxxxxRequires optional AI voice interaction module + speaker
For voice module installation, environment configuration, and basic wake-up flow, please refer directly to [04-AI Voice Interaction Configuration]. After waking up, you can directly speak control content, for example:
- Make the lights red
- Turn on blue breathing light
- Make the lights flow like a rainbow

6. Comprehensive Cases
Note: All demonstrations below use the openclaw tui method for conversation. You can also choose WhatsApp or voice to complete.
6.1 Case 1: Solid Color Lighting
Experiment Objective
Have the RGB lights stably display a fixed color for the most basic light control.
Effect Description
After the RGB lights receive the command, all LEDs display the specified color uniformly, such as red, green, blue, white, or warm white. This case is suitable for verifying whether color mapping is normal.
Example Commands
- Set all RGB lights to red
- Change the light strip to blue
- Set the lights to warm white
6.2 Case 2: Breathing Light
Experiment Objective
Have the RGB lights do brightness gradient on a certain color, forming a breathing light effect.
Effect Description
RGB lights will change cycle from dark to bright and then bright to dark, with a relatively soft overall effect, suitable for standby prompts, ambient lights, or status indicator lights.
Example Commands
- Turn on blue breathing light
- Make the lights turn into green breathing effect
- Slow down the breathing light speed
6.3 Case 3: Warning Flash
Experiment Objective
Have the RGB lights simulate warning or alarm effects through rapid flashing.
Effect Description
Lights can flash quickly in red, yellow, or alternating red and blue, suitable for expressing "attention", "warning", "abnormal status", etc., with more obvious visual feedback.
Example Commands
- Make the lights flash red
- Turn on yellow warning light
- Make RGB lights flash quickly three times
6.4 Case 4: Rainbow Marquee
Experiment Objective
Have RGB lights form a continuous flowing dynamic effect, showcasing richer light performance.
Effect Description
LED colors will change sequentially and flow forward, looking like a rainbow flowing light or marquee. This effect is very suitable for boot animations, display animations, or interactive lighting.
Example Commands
- Turn on rainbow light effect
- Make the lights flow like a marquee
- Turn on blue flowing light with faster speed