#include // Define which pin the NeoPixel data line is connected to #define PIN 6 // Define how many NeoPixels are in your strip/ring/single LED #define NUMPIXELS 1 // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (6 in this case) // Parameter 3 = Pixel type flags (NEO_GRB is common for NeoPixels) Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); // Array of colors (Red, Green, Blue) uint32_t colors[] = { pixels.Color(255, 0, 0), // Red pixels.Color(0, 255, 0), // Green pixels.Color(0, 0, 255) // Blue }; // Index to track the current color int colorIndex = 0; // Total number of colors in the array const int numColors = sizeof(colors) / sizeof(colors[0]); void setup() { // Initialize the NeoPixel object pixels.begin(); } void loop() { // Set the color for the first pixel (index 0) pixels.setPixelColor(0, colors[colorIndex]); // This command sends the data to the NeoPixel, making it light up! pixels.show(); // Move to the next color in the array colorIndex = (colorIndex + 1) % numColors; // Wait for 500 milliseconds (half a second) delay(500); }