esp32_ws2812b

Crates.ioesp32_ws2812b
lib.rsesp32_ws2812b
version0.1.0
created_at2025-07-16 04:00:24.803967+00
updated_at2025-07-16 04:00:24.803967+00
descriptionA crate that provides control over the WS2812B LED.
homepagehttps://github.com/wendell1002/esp32-ws2812b
repositoryhttps://github.com/wendell1002/esp32-ws2812b
max_upload_size
id1754879
size47,531
(wendell1002)

documentation

https://docs.rs/esp32-ws2812b

README

WS2812B

A library to drive the WS2812B LED.

Play one 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);
    }

...

Build for different esp32 targets

cargo run --features esp32c3
Commit count: 0

cargo fmt