/
Color

Color

Purpose

To define a color.

When to use

When you want to control the NeoPixel.

Where to use

Typically at the top of the file, in a color pattern, or when calling SetColor.

Main prototype and parameters

void CrcLib::Color(unsigned char red, unsigned char green, unsigned char blue)

The NeoPixel is quite bright. You probably don’t want to set any value over 25.

Constants

The CRC defines the following Color constants:

  • NO_COLOR

  • RED_HIGH / RED_LOW

  • GREEN_HIGH / GREEN_LOW

  • BLUE_HIGH / BLUE_LOW

  • YELLOW_HIGH / YELLOW_LOW

  • CYAN_HIGH / CYAN_LOW

  • MAGENTA_HIGH / MAGENTA_LOW

  • WHITE_HIGH / WHITE_LOW

  • ORANGE_HIGH

The _HIGH variants are very bright and should be used very briefly if at all. The _LOW values are less bright and typically what one would use.

ColorDuration

ColorDuration is a type that includes a color and a duration, used for a pattern displayed by the CrcDuino. The ColorDuration::END indicates the end of a pattern.

Make sure to add the ColorDuration::END at the end of your pattern, else very weird patterns will display.

Use it as such:

// Define a color pattern. Notice the ColorDuration::END at the end. const ColorDuration PATTERN_ERROR1[] = { { 150, RED_LOW }, { 150, NO_COLOR }, { 150, RED_LOW }, { 150, NO_COLOR }, { 400, YELLOW_LOW }, { 2000, NO_COLOR }, ColorDuration::END };

Related articles

Related content

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