10 releases (4 breaking)
0.5.0 | Jun 26, 2025 |
---|---|
0.4.0 | May 27, 2025 |
0.3.3 | May 22, 2025 |
0.2.3 | May 16, 2025 |
0.1.0 | May 1, 2025 |
#1856 in Embedded development
148 downloads per month
195KB
2.5K
SLoC
gledopto
Rust no-std embedded board support crate for Gledopto ESP32 Digital LED controllers.
Uses Blinksy: an LED control library for 1D, 2D, and soon 3D LED setups, inspired by FastLED and WLED.
Supported Boards
Currently this library only supports one board:
- Gledopto GL-C-016WL-D,
gl_c_016wl_d
Select the board by using its respective feature.
Features
- 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
Click to see code
#![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.),
horizontal_end: Vec2::new(1., -1.),
vertical_end: Vec2::new(-1., 1.),
horizontal_pixel_count: 16,
vertical_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
Click to see code
#![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
To quickstart a project, see blinksy-quickstart-gledopto
.
Resources
As the Gledopto controller is an ESP32, if you want to get started here are some more resources to help:
- The Rust on ESP Book: An overall guide on ESP32 on Rust
- esp-hal: The Hardware Abstraction Layer for an ESP32 on Rust
- espup: How to install the Xtensa target for Rust, required for ESP32
- esp-generate: A template to help you kickstart your project
And in case they are helpful:
Dependencies
~69MB
~1.5M SLoC