// Include the NeoPixel library for LED strip control
#include<neoPixel.h>
// Define hardware connections and configuration
#define LED_PIN 9 // Digital pin for LED data signal
#define NUM_LEDS 30 // Number of LEDs in the strip
// Create NeoPixel strip object
neoPixel strip = neoPixel(NUM_LEDS, LED_PIN);
void setup() {
// Initialize LED strip
strip.begin(); // Init.
strip.setAll(&black); // Lets go dark.
strip.show(); // Show it.
}
void loop() {
// Cycle through colors using predefined values
strip.setAll(&red);
strip.show();
delay(1000);
strip.setAll(&green);
strip.show();
delay(1000);
strip.setAll(&blue);
strip.show();
delay(1000);
strip.setAll(&black);
strip.show();
delay(1000);
}