Segment Set Check - AlbertGBarber/PixelSpork GitHub Wiki

See the Documentation Guide for help understanding each page section.

Description:

A utility effect to verify the layout of a segment set. See Segment Basics for more info on segment sets. The utility behaves like a regular effect, with updating, etc. For a pre-configured example, see the "Segment Set Check" example under "examples" in the Arduino IDE.

For a given segment set, two tests can be performed:

  • 0 -- For each segment in the segment set, the first and last pixels will be set to red and blue respectively, while the rest of the segment is lit up in green, one pixel at a time, in order of the segment direction. The segments are lit matching their order in the segment set.

  • 1 -- Colors the first and last segment lines in red and blue respectively, while the other lines are flashed in green, one by one, matching their order in the segment set.

What modes are run is based on the testMode value:

  • 0 -- Runs only testing mode 0, repeating.
  • 1 -- Runs only testing mode 1, repeating.
  • 2+ -- Runs both testing modes, one after another, repeating.

By default the effect's update rate is 500ms, or you can configure it as part of the constructor.

Test Mode 0 on 2D Disk Segment Set Test Mode 1 on 2D Disk Segment Set
Effect on 1D Segment Set Effect on Disk Segment Set

Example Calls:

SegmentSetCheckPS segmentSetCheck(mainSegments, 2);
/*  Does tests 0 and 1 on the mainSegments segment set.
    The default update rate of 500ms will be used. */

SegmentSetCheckPS(mainSegments, 1, 1000);
/*  Does test 1 on the mainSegments segment set.
    The update rate is set to 1000ms. */

Constructor Definitions:

//Constructor (500ms default rate, but you may supply your own)
SegmentSetCheckPS(SegmentSetPS &SegSet, uint8_t TestMode, uint16_t Rate = 500);

Constructor Inputs:

  • SegmentSetPS* segSet -- The segment set you want to test. See common vars segSet entry for more details.

  • uint8_t testMode -- The type of test to be done Passing in 2+ will do both tests. (See intro above to test info).

  • uint16_t* rate (optional, default 500ms) -- The utility update rate (ms).

Other Settings:

  • 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. Only here to be in line with other effects; there's no reason to ever turn showing off for this utility.

Class Functions:

  • void update();
    Updates the effect.

Reference Vars:

  • uint8_t mode -- The current test mode being run.
⚠️ **GitHub.com Fallback** ⚠️