# WS2812 LED Control on Lonely Binary ESP32-S3
## Overview
The Lonely Binary ESP32-S3 features a built-in WS2812 RGB LED connected to pin IO48. This addressable LED can display millions of colors and create stunning visual effects. This guide will teach you how to control this LED using MicroPython.
## Understanding WS2812 LEDs
### What is a WS2812 LED?
WS2812 LEDs are addressable RGB LEDs that can display any color by combining red, green, and blue light at different intensities. Each LED can be controlled individually, making them perfect for creating complex lighting patterns.
## Hardware Setup
### Lonely Binary ESP32-S3 WS2812 Configuration
- **Pin**: IO48
- **Built-in**: No external wiring needed
- **Library**: `neopixel` (included in MicroPython)
## Basic WS2812 Control
### Simple Setup and Test
```python
# basic_ws2812.py - Basic WS2812 control
import machine
import neopixel
import time
# Configure WS2812 LED on pin IO48
# neopixel.NeoPixel(pin, number_of_leds, bpp=3, timing=1)
np = neopixel.NeoPixel(machine.Pin(48), 1)
def set_color(r, g, b):
"""Set LED to specific RGB color"""
np[0] = (r, g, b)
np.write()
def test_colors():
"""Test basic colors"""
colors = [
(255, 0, 0), # Red
(0, 255, 0), # Green
(0, 0, 255), # Blue
(255, 255, 0), # Yellow
(255, 0, 255), # Magenta
(0, 255, 255), # Cyan
(255, 255, 255) # White
]
print("Testing basic colors...")
for i, color in enumerate(colors):
set_color(*color)
print(f"Color {i+1}: RGB{color}")
time.sleep(1)
# Turn off LED
set_color(0, 0, 0)
print("Color test complete!")
# Run test
test_colors()
```
## Conclusion
The WS2812 LED on the Lonely Binary ESP32-S3 provides endless possibilities for visual feedback and creative projects. From simple status indicators to complex lighting effects, this single LED can communicate information, create ambiance, and add visual appeal to your projects. Start with the basic examples and gradually explore more advanced effects. The WS2812 LED is not just a simple indicator - it's a powerful tool for user interface design and artistic expression in embedded systems.
- Choosing a selection results in a full page refresh.