Theater Chase (Seg Line) - AlbertGBarber/PixelSpork GitHub Wiki

See the Documentation Guide for help understanding each page section.

Effect Sample (see here for sample info)
Effect Sample Gif

Description:

A classic theater chase effect; one color running on top of another with spaces in between. You can customize the spacing between and the size of the running colors. For example, lets say you have red spots of length 2, running on a blue background, with 3 spaces in between each red spot. The result would be ( r, r, b, b, b, r, r, etc) were r = red, b = blue.

Note: the minimum value for both the color spot size and spacing is 1.

The effect is adapted to work on segment lines for 2D use. Each segment line will be a single color.

Supports color modes for both the main and background colors.

For more advanced versions of this effect, see Streamer (Seg Line) and Segment Waves (Seg).

Example Calls:

TheaterChaseSL theaterChase(mainSegments, CRGB::Red, CRGB::Green, 1, 2, 100);
/*  Red spots of length 1, running on a green background, 
    with 2 spaces in between each spot, 
    updating at 100ms */

Constructor Definitions:

TheaterChaseSL(SegmentSetPS &SegSet, CRGB Color, CRGB BgColor, uint16_t LitLength, uint16_t Spacing, uint16_t Rate);

Constructor Inputs:

  • SegmentSetPS* segSet -- The Segment Set the effect will draw on. See common vars segSet entry for more details.

  • CRGB* color -- The color of the running spots. Note that like the bgColor, it is a pointer, allowing you to bind it externally. By default it's bound to the effect's local, colorOrig color. See common vars bgColor entry for more details.

  • CRGB* bgColor -- The color used for background pixels. Is a pointer, allowing you to bind it to an external color. By default it's bound the effect's local, bgColorOrig color. See common vars bgColor entry for more details.

  • uint16_t litLength (min 1) -- The size of the color spots.

  • uint16_t spacing (min 1) -- The size of the spacing between spots.

  • uint16_t* rate -- Update rate (ms). Is a pointer, allowing you to bind it to an external variable. By default it's bound the effect's local variable, rateOrig. See common vars rate entry for more.

Other Settings:

  • uint8_t colorMode (default 0) -- The colorMode use for the effect, also see common vars colorMode entry for more details.

  • uint8_t bgColorMode (default 0) -- The colorMode used for the background pixels, also see common vars colorMode entry for more details.

  • bool showNow (default true) -- Controls if the effect "draws" during each update cycle by calling FastLED.show(). Common to all effects. See common vars showNow entry for more details.

Class Functions:

  • void update();
    Updates the effect.

Reference Vars:

  • uint16_t cycleNum -- Tracks the number of update cycles, resets every (spacing + litLength) cycles.
⚠️ **GitHub.com Fallback** ⚠️