| Crates.io | esp32_ws2812b |
| lib.rs | esp32_ws2812b |
| version | 0.1.0 |
| created_at | 2025-07-16 04:00:24.803967+00 |
| updated_at | 2025-07-16 04:00:24.803967+00 |
| description | A crate that provides control over the WS2812B LED. |
| homepage | https://github.com/wendell1002/esp32-ws2812b |
| repository | https://github.com/wendell1002/esp32-ws2812b |
| max_upload_size | |
| id | 1754879 |
| size | 47,531 |
A library to drive the WS2812B LED.
...
esp_println::logger::init_logger_from_env();
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
let peripherals = esp_hal::init(config);
esp_alloc::heap_allocator!(size: 64 * 1024);
let delay = Delay::new();
let mut r = WS2812B::new(peripherals.RMT, 80, peripherals.GPIO8).unwrap();
loop {
r = r.fade(colors::BLUE, 1).expect("Failed to dispatch!");
// r = r
// .send(colors::ALICE_BLUE, 10, 1)
// .expect("Failed to dispatch!");
// delay.delay_millis(500);
// r = r
// .send(colors::CHOCOLATE, 10, 1)
// .expect("Failed to dispatch!");
// delay.delay_millis(500);
// r = r.send(colors::OLIVE, 10, 1).expect("Failed to dispatch!");
delay.delay_millis(500);
}
...
cargo run --features esp32c3