#include <Adafruit_NeoPixel.h>
#define PIN 5 // GPIO pin connected to LED matrix data input
#define NUMPIXELS 256 // 8 x 32 = 256 LEDs
Adafruit_NeoPixel strip(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Define a palette of colors inspired by the bamboo forest image
uint32_t palette[] = {
strip.Color(34, 139, 34), // Forest Green
strip.Color(50, 205, 50), // Lime Green
strip.Color(107, 142, 35), // Olive Drab
strip.Color(154, 205, 50), // Yellow Green
strip.Color(85, 107, 47), // Dark Olive Green
strip.Color(189, 183, 107), // Dark Khaki (brownish-yellow)
strip.Color(222, 184, 135), // Burlywood (light brown)
strip.Color(240, 230, 140) // Khaki (yellowish)
};
const int paletteSize = sizeof(palette) / sizeof(palette[0]);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Animate colors cycling through the palette
for (int j = 0; j < paletteSize; j++) {
fillColor(palette[j]);
delay(500);
}
}
// Fill the entire matrix with one color
void fillColor(uint32_t color) {
for (int i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
}
strip.show();
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1
https://wokwi.com/projects/new/esp32-s3
https://wokwi.com/projects/463068950445342721