View Source Delux.Effects (delux v0.1.0)

Functions for creating a variety of LED patterns

Link to this section Summary

Types

Option effects (none yet)

Functions

Create a transient two color sequence

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

Link to this function

blink(c, frequency, options \\ [])

View Source
@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.

Link to this function

blip(c1, c2, options \\ [])

View Source
@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.

Link to this function

cycle(colors, frequency, options \\ [])

View Source
@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

Link to this function

waveform(fun, period, options \\ [])

View Source
@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.