Skip to content

LinesEffectModule

Animated crossing lines, adapted from MoonLight's Lines effect. Introduced in Release 3, Sprint 1.


What it does

On each loop() call, LinesEffectModule draws two lines that sweep in sync at a given BPM:

  • Red vertical line — sweeps left → right across all rows
  • Green horizontal line — sweeps top → bottom across all columns

Both lines share the same beat position, so their crossing point traces a diagonal path. The buffer is cleared to black each frame. Where the lines cross, green wins (last write).

Position is derived from a sawtooth beat (FastLED beat16 equivalent):

period = 60 000 ms / bpm
beat   = (millis % period) × 65535 / period     // 0 → 65535 sawtooth
x      = beat × (width  − 1) / 65535
y      = beat × (height − 1) / 65535

Controls

Parameter Source Default Description
layer setInput("layer", ...) EffectsLayer* to write into
bpm setProps / loadState 30 Animation speed in beats per minute (1–240)
enabled auto (StatefulModule) true When false, loop() is skipped

Platform notes

Uses only integer arithmetic inside beat16(). The module owns no pixel memory. On ESP32, timeMicros() resolves to esp_timer_get_time().


Test coverage

Live pipeline: test2 — Lines added — LinesEffectModule added alongside Ripples; both EffectsLayers blended simultaneously by DriverLayer on PC and ESP32.

Source