Effect Page Template - 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:

The effect is adapted to work on segment lines for 2D use.

Supports color modes for both the main and background colors.

These are allocated dynamically, so, to avoid memory fragmentation, when you create the effect, you should set numTwinkles to the maximum value you expect to use. See Memory Management for more details.

Warning, this effect uses dynamic memory allocation related to <>. If you plan changing <> during runtime you should set its length to the maximum expected value when you create the effect. This helps prevent memory fragmentation while ensuring that you have enough memory to run the effect. You can read more about memory management here. Also note that if you create this effect without a pattern (ie using your palette as the pattern), a pattern will be created dynamically. This is also true if you call setPaletteAsPattern() later.

Inputs Guide & Notes:

Example Calls:

Constructor Definitions:

Constructor Inputs:

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

  • palettePS* palette (optional, see constructors) -- The set of colors the effect will use. See palettes. It is a pointer. See common vars palette entry for more details.

  • patternPS* pattern (optional, see constructors) -- The color pattern the effect will use. See patterns. It is a pointer. See common vars pattern entry for more details.

  • uint8_t numColors (optional, see constructors) -- The number of randomly chosen colors for the effect. The colors will be placed into the effect's local palette, paletteTemp for use.

  • CRGB color (optional, see constructors) -- A single color for the effect. The color will be placed into the effect's local palette, paletteTemp for use.

  • 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 Var -- Blah.

  • 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.

  • CRGB bgColorOrig -- The default target of the effect's bgColor pointer. Will be set to the passed in BgColor from the constructor. See common vars bgColor entry for more details.

  • CRGB rateOrig -- The default target of the effect's rate pointer. Will be set to the passed in Rate from the constructor. See common vars rate entry for more details.

  • bool fillBg (default false) -- If true, then all pixels will be re-colored with each update(), rather than just drawing those that have changed. See common vars fillBg entry for more details.

  • uint8_t sat and val (both default 255) -- HSV saturation and "value" values for rainbow mode. See Common Vars "sat and hue" entry for more.

  • bool active (default true) -- If false, the utility/effect will be disabled (updates() will be ignored). See common vars active 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.

  • type var (default 255) -- desc

Class Functions:

  • void someFunction( uint16_t someArg ); 

    blah

  • void setPaletteAsPattern();

    Sets the effect pattern to match the current effect palette. See Common Functions for more.

  • void setPatternAsPattern(patternPS &inputPattern, uint16_t colorLength, uint16_t spacing);

    Takes an input pattern and creates a color pattern from with streamers of colorLength and spacing background spaces in-between. A short-hand for turning a short pattern into a full pattern for the effect. See Common Functions for more.

  • void reset();

    Restarts the effect from its initial state.

  • void update();

    Updates the effect.

Reference Vars:

  • uint16_t numCycles -- Tracks how many full cycles the effect has completed.

  • type var -- desc

Flags:

  • bool var -- desc
⚠️ **GitHub.com Fallback** ⚠️