/
ShowColorPattern

ShowColorPattern

Purpose

Display a sequence of colors on the NeoPixel.

When to use

When you want to start the pattern.

Where to use

Anywhere.

Calling this function again will stop a pattern that was already executing. Make sure to not call it repeatedly.

Returns

N/A

Main prototype and parameters

void CrcLib::ShowColorPattern(const ColorDuration colors[], bool repeat)

The following parameters must be passed to the function for it to work properly:

  • The sequence of colors to display

  • Whether to loop the pattern

Overloads

void CrcLib::ShowColorPattern(ColorPattern* pattern)

A more advanced version of the function you probably don’t need. If you want to use it, read CrcLib.h for more info.

Examples

#include <CrcLib.h> // See the page about Color // Define a pattern using { <duration in ms>, <note frequency in Hz> } ColorDuration pattern[] = { { 750, Color(213, 4, 200) }, { 500, BLUE_LOW }, ColorDuration::END }; CrcLib::Timer timer; void setup() { CrcLib::Initialize(); timer.Start(2000); } void loop() { CrcLib::Update(); if (timer.IsFinished()) { // start the sequence every 2s timer.Next(); CrcLib::ShowColorPattern(pattern, false); } }

Related articles

Content by Label

Related content

ShowColorPattern {FR}
ShowColorPattern {FR}
More like this
SetColor
More like this
Color {FR}
More like this
SetColor {FR}
More like this