#include <Adafruit_NeoPixel.h>
int N_LED = 40;
int din = 12;
Adafruit_NeoPixel ring = Adafruit_NeoPixel(N_LED, din);
void setup() {
Serial.begin(9600);
ring.begin();
}
void loop() {
// First set of colors
glowColors(255, 0, 0, "Red");
glowColors(0, 255, 0, "Green");
glowColors(0, 0, 255, "Blue");
// Second set of colors
glowColors(255, 255, 0, "Yellow");
glowColors(255, 255, 255, "White");
glowColors(255, 182, 193, "Pink");
// Repeat the loop
}
void glowColors(int red, int green, int blue, String colorName) {
for (int i = 0; i < N_LED; i++) {
ring.setPixelColor(i, ring.Color(red, green, blue));
ring.show();
delay(1000);
}
// Display color name on console
Serial.println(colorName);
// Pause before switching to the next color
delay(200);
}