gledopto 0.2.0

no-std, no-alloc LED control library designed for 1D, 2D, and 3D layouts
docs.rs failed to build gledopto-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gledopto-0.11.0

gledopto

Rust no-std embedded board support crate for Gledopto ESP32 Digital LED controllers.

Uses Blinksy: an LED control library designed for 1D, 2D, and 3D (audio-reactive) LED setups, inspired by FastLED and WLED.

Supported Boards

Currently this library only supports one board:

Select the board by using its respective feature.

Features

  • 1D, 2D, or 3D LED control using blinksy
  • Built-in "Function" button
  • Alternative "IO33" button
  • Built-in microphone

Examples

2D APA102 Grid with Noise Pattern

https://github.com/user-attachments/assets/1c1cf3a2-f65c-4152-b444-29834ac749ee

#![no_std]
#![no_main]

use blinksy::{
    layout::{Shape2d, Vec2},
    layout2d,
    patterns::noise::{noise_fns, Noise2d, NoiseParams},
    ControlBuilder,
};
use gledopto::{apa102, board, elapsed, main};

#[main]
fn main() -> ! {
    let p = board!();

    layout2d!(
        Layout,
        [Shape2d::Grid {
            start: Vec2::new(-1., -1.),
            row_end: Vec2::new(1., -1.),
            col_end: Vec2::new(-1., 1.),
            row_pixel_count: 16,
            col_pixel_count: 16,
            serpentine: true,
        }]
    );
    let mut control = ControlBuilder::new_2d()
        .with_layout::<Layout>()
        .with_pattern::<Noise2d<noise_fns::Perlin>>(NoiseParams {
            ..Default::default()
        })
        .with_driver(apa102!(p))
        .build();

    control.set_brightness(0.1);

    loop {
        let elapsed_in_ms = elapsed().as_millis();
        control.tick(elapsed_in_ms).unwrap();
    }
}

1D WS2812 Strip with Rainbow Pattern

https://github.com/user-attachments/assets/703fe31d-e7ca-4e08-ae2b-7829c0d4d52e

#![no_std]
#![no_main]

use blinksy::{
    layout::Layout1d,
    layout1d,
    patterns::rainbow::{Rainbow, RainbowParams},
    ControlBuilder,
};
use gledopto::{board, elapsed, main, ws2812};

#[main]
fn main() -> ! {
    let p = board!();

    layout1d!(Layout, 60 * 5);

    let mut control = ControlBuilder::new_1d()
        .with_layout::<Layout>()
        .with_pattern::<Rainbow>(RainbowParams {
            ..Default::default()
        })
        .with_driver(ws2812!(p, Layout::PIXEL_COUNT))
        .build();

    control.set_brightness(0.2);

    loop {
        let elapsed_in_ms = elapsed().as_millis();
        control.tick(elapsed_in_ms).unwrap();
    }
}

Getting started

Pre-requisites

  • Install Rust with rustup
  • Install ESP components
cargo install espup
espup install
  • Install espflash
cargo install espflash
  • On Linux, add user to dialout group
sudo adduser $USER dialout

Run An Example

Source the ESP environment variables

. $HOME/export-esp.sh

(See also: https://docs.esp-rs.org/book/installation/riscv-and-xtensa.html#3-set-up-the-environment-variables )

Clone this repository and go into the ./esp workspace:

git clone git@github.com:ahdinosaur/blinksy
cd blinksy/esp

Run an example:

cargo run --release -p gledopto --example ws2812-strip

Resources