smart_led_effects

Crates.iosmart_led_effects
lib.rssmart_led_effects
version0.1.7
sourcesrc
created_at2023-09-10 04:46:43.399315
updated_at2023-09-19 06:14:33.592281
descriptionA collection of effects for LED strips
homepagehttps://github.com/bitbrain-za/smart-led-effects-rs
repositoryhttps://github.com/bitbrain-za/smart-led-effects-rs
max_upload_size
id968572
size55,264
(bitbrain-za)

documentation

README

Smart LED Effects

This supplies a collection of effects for usage with individually addressable LED strips such as the WS2812b. Each effect returns a vector of colours that can then be sent to your LED driver.

The EffectIterator trait defines two methods: - name - next

name will just return the name as a static string slice. next will return the next page of the effect. It uses the Option enum, and in the future there will be One Shot effects that end and return None. For now, all effects will loop.

This crate borrows heavily from fastLED and tweaking4all. The majority of the effect art is taken straight from here, andd reimplemented in Rust.

Dimensionality

Currently only works for strips/loops. But someday the plan is to extend it.

Effects

- Breathe
- Bounce
- Collision
- Cylon
- Fire
- Meteor
- Morse
- ProgressBar
- Rainbow
- RunningLights
- SnowSparkle
- Strobe
- Timer
- Twinkle
- Wipe

Example Usage

[dependencies]
smart_led_effects = 0.1.7


use smart_led_effects::{
    strip::{self, EffectIterator},
    Srgb,
};

//...

    const COUNT: usize = 55;
    let effect = strip::Rainbow::new(COUNT, None);

    loop {
        let pixels = effect.next().unwrap();
    
        // show pixels

        thread::sleep(Duration::from_millis(10));
    }


References

Commit count: 42

cargo fmt