What problem does it solve?
Driving addressable LEDs like WS2812B requires extremely precise timing, which can be challenging for microcontrollers with other tasks. This Skill leverages the ESP32's RMT (Remote Control) peripheral to generate nanosecond-accurate pulse sequences, ensuring perfect LED timing without CPU intervention, eliminating flicker and timing glitches for flawless visual effects.
Core Features & Use Cases
- Cycle-Accurate Timing: Utilize hardware-driven RMT for precise control of WS2812B, APA102, and SK6812 LEDs.
- DMA-Capable Output: Offload LED data transmission from the CPU, enabling high-speed updates for large LED arrays.
- Multi-Channel Control: Configure up to 8 simultaneous LED lines for complex setups.
- Use Case: Build high-density LED displays, create professional-grade light art installations, or ensure reliable LED feedback in real-time embedded systems where timing is critical.
Quick Start
Minimal WS2812B setup using RMT
#define LED_PIN GPIO_NUM_9
#define NUM_LEDS 100
rmt_config_t config = {
.rmt_mode = RMT_MODE_TX,
.channel = RMT_CHANNEL_0,
.clk_div = 8,
.gpio_num = LED_PIN,
.mem_block_num = 1,
.tx_config = { .loop_en = false, .carrier_en = false, .idle_level = RMT_IDLE_LEVEL_LOW, .idle_output_en = true, }
};
rmt_config(&config);
rmt_driver_install(RMT_CHANNEL_0, 0, 0);