View Source Delux.Effects (delux v0.1.0)
Functions for creating a variety of LED patterns
Link to this section Summary
Functions
Blink an indicator
Create a transient two color sequence
Cycle between colors
All LEDs off
Set an indicator to the specified color
Create a program from an arbitrary function
Link to this section Types
@type options() :: []
Option effects (none yet)
Link to this section Functions
@spec blink(Delux.RGB.t(), number(), options()) :: Delux.Program.t()
Blink an indicator
This returns a pattern that blinks the specified color at a 50% duty cycle. The pattern starts on and then goes off.
@spec blip(Delux.RGB.t(), Delux.RGB.t(), options()) :: Delux.Program.t()
Create a transient two color sequence
The first color is shown for 20 ms. 10 ms in, the second color is shown for 20 ms. The Effects is a quick flash of light that can be used to show feedback to a button. Total duration of the Effects is 40 ms.
@spec cycle([Delux.RGB.t()], number(), options()) :: Delux.Program.t()
Cycle between colors
Colors are shown with equal duration determined from the specified frequency.
@spec off() :: Delux.Program.t()
All LEDs off
@spec on(Delux.RGB.t(), options()) :: Delux.Program.t()
Set an indicator to the specified color
@spec waveform((... -> any()), non_neg_integer(), options()) :: Delux.Program.t()
Create a program from an arbitrary function
Pass in a function that takes times in milliseconds and returns colors. The returned pattern piecewise linearly interpolates the waveform.