/*
Wokwi | questions
ESP32 led strip
Krilly — 12/27/2025 6:27 AM
*/
#include <Adafruit_NeoPixel.h>
const int LED_PIN = 15;
const int LED_COUNT = 7;
struct colorData {
int red;
int grn;
int blu;
char * name;
};
const colorData COLOR_DATA[] {
{240, 255, 0, "Morning"},
{0, 255, 0, "Noon"},
{0, 180, 255, "Evening"}
};
const char * dayOfWeek[] = {
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(115200);
strip.begin();
strip.setBrightness(50);
strip.show();
}
void loop() {
for (int pixel = 0; pixel < LED_COUNT; pixel++) {
strip.clear();
for (int color = 0; color < 3; color++) {
strip.setPixelColor(
pixel,
COLOR_DATA[color].red,
COLOR_DATA[color].grn,
COLOR_DATA[color].blu
);
strip.show();
Serial.print(dayOfWeek[pixel]);
Serial.print(" ");
Serial.println(COLOR_DATA[color].name);
delay(2000);
}
}
}