The ColorWipe pattern paints a color, one pixel at a time, over the length of the strip.
Initialization:
The ColorWipe() function initializes the NeoPattern object to execute the ColorWipe pattern.
The color parameter specifies the color to 'wipe' across the strip.
The interval parameter specifies the number of milliseconds between successive pixels in the wipe.
The direction parameter is optional and specifies the direction of the wipe. The default direction, if not specified is FORWARD.
TotalSteps is set to the number of pixels in the strip.
// Initialize for a ColorWipe void ColorWipe(uint32_t color, uint8_t interval, direction dir = FORWARD) { ActivePattern = COLOR_WIPE; Interval = interval; TotalSteps = numPixels(); Color1 = color; Index = 0; Direction = dir; }
Update:
The ColorWipeUpdate() function sets the next pixel in the strip, then calls show() to write to the strip and Increment() to update the Index.
// Update the Color Wipe Pattern void ColorWipeUpdate() { setPixelColor(Index, Color1); show(); Increment(); }
Page last edited January 28, 2015
Text editor powered by tinymce.