#include <Adafruit_NeoPixel.h>
#define PIN 12
#define NUMPIXELS 16
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
const int l[3][3] = {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}};
void setup() {
// put your setup code here, to run once:
pixels.begin();
}
int cnt = 0;
void loop() {
// put your main code here, to run repeatedly:
for (int j = 0; j < 16; j++) {
for (int i = 0; i < 16; i++)
if (i <= j)
pixels.setPixelColor(i, l[cnt][0], l[cnt][1], l[cnt][2]);
else
pixels.setPixelColor(i, 0, 0, 0);
pixels.show();
delay(100);
}
if (++cnt > 2) cnt = 0;
}