The ColorWipe pattern paints a color, one pixel at a time, over the length of the strip.  


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;


 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);

This guide was first published on Mar 02, 2015. It was last updated on Mar 27, 2024.

This page (ColorWipe) was last updated on Jan 28, 2015.

Text editor powered by tinymce.