NeoPixel Ring

Make all the pixels the starting color
Starting marker is zero

  • Change the marker to the marker color and wait
  • Change the marker back to the starting color
  • At the end of the ring change the starting marker to the final color
  • Increment the starting marker and go around again
  • Repeat until the last pixel was the starting marker

I have an 8x8 LED matrix and use the FastLED library, so if you want to base your program on my demo code you'll have to convert to the Adafruit library. Also, it goes fast for testing, you'll have to work out the timing. It is tested working, though.

#include "FastLED.h"

#define START_COLOR CRGB::Red
#define MARKER_COLOR CRGB::White
#define FINAL_COLOR CRGB::grg

#define NUM_LEDS 64

#define DATA_PIN 3
CRGB leds[NUM_LEDS];

// starting place for marker for each pass
int startLED = 0;

void setup() {

  // init leds
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(84);


  // set all to start color
  for (int i = 0; i < NUM_LEDS; i++) {

    leds[i] = START_COLOR;
  }

  FastLED.show();
  delay(500);

}

void loop()
{

  // if we have not changed colors of all LEDs
  if ( startLED < NUM_LEDS )
  {

    // while more LEDs for this pass
    for (int i = startLED; i < NUM_LEDS; i++)
    {

      // change marker
      leds[i] = MARKER_COLOR;
      FastLED.show();
      delay(10);

      // marker back to original color
      leds[i] = START_COLOR;
      delay(10);
      FastLED.show();

    } // for

    // the LED we strted on goes to final color
    leds[startLED] = CRGB::Green;
    FastLED.show();

    // advance starting LED
    startLED++;

  }


}