#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 16
Adafruit_NeoPixel pixels(NUMPIXELS,PIN,NEO_GRB + NEO_KHZ800);
unsigned char R = 0, G = 255, B = 0;
void setup() {
pixels.begin();
// put your setup code here, to run once:
}
void loop() {
for(int shift = 0; shift < NUMPIXELS; shift++){
for(int j = 0; j < NUMPIXELS; j++){
if(((j + shift)%NUMPIXELS < 3) || ((j+shift) % NUMPIXELS >= 8 && (j + shift) % NUMPIXELS < 11)){
pixels.setPixelColor(j,pixels.Color(R,G,B));
}else{
pixels.setPixelColor(j,pixels.Color(0,0,0));
}
}
pixels.show();
delay(50);
if (R++ > 254) {
R = 255;
if (B++ > 254) {
B = 255;
if (G-- < 1) {
G = 255;
B = 0;
R = 0;
}
}
}
}
// put your main code here, to run repeatedly:
}