Expand description

A library that generates effects for use with addressable LEDs. Currently it only implements 1 dimensional effects for use with a single strip of LEDs.

Usage

Each effect is implemented as an iterator that returns a vector of Srgb colours. The vector returned is the same length as the number of LEDs in the strip (supplied when instantiating the effect). This vector can then be passed to the LED strip driver.

The strip::EffectIterator trait is implemented for each effect, so they can be used as iterators. The iterators will currently all loop forever.

Effects

NameDescription
strip::BounceThe bounce effect will generate a number of balls that bounce up and down the strip
strip::BreatheThe breathe effect will generate a single colour that fades in and out
strip::Christmas(WIP) Has a green background with random red, blue and gold sparkles
strip::CollisionGenerates two particles that can collide and bounce or shatter
strip::CycleRotates around the HSV colour space
strip::CylonGenerates the cylon eye effect
strip::FireGenerates an effect like a flickering flame
strip::MeteorGenerates a meteor that goes down the strip trailing bits of fading debris
strip::MorseConverts a string into a series of dots and dashes as per Morse code formatting
strip::ProgressBar(WIP) Signals progress
strip::RainbowGenerates a rainbow effect
strip::RunningLightsGenerates a running lights effect
strip::SnowSparkleGenerates random sparkles
strip::StrobeStrobe light/blinder effect
strip::TimerCounts down for the given duration
strip::TwinkleGenerates random twinkles
strip::WipeGenerates a wipe effect

Example

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


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

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

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

Modules

Type Aliases

  • Non-linear sRGB.