#include <Adafruit_NeoPixel.h>
int Power = 11; // Power pin for the NeoPixel
int PIN = 12; // Data pin for the NeoPixel
#define NUMPIXELS 1
int Button = D1; // Pin D1 connected to the button
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
pinMode(Power, OUTPUT);
pinMode(Button, INPUT);
digitalWrite(Power, HIGH);
}
void loop() {
int buttonState = digitalRead(Button);
if (buttonState == HIGH) {
pixels.clear();
pixels.show();
} else {
pixels.clear();
pixels.setPixelColor(0, pixels.Color(15, 25, 205));
pixels.show();
delay(400);
pixels.clear();
pixels.setPixelColor(0, pixels.Color(103, 25, 205));
pixels.show();
delay(400);
pixels.clear();
pixels.setPixelColor(0, pixels.Color(233, 242, 205));
pixels.show();
delay(400);
pixels.clear();
pixels.setPixelColor(0, pixels.Color(233, 23, 23));
pixels.show();
delay(400);
pixels.clear();
pixels.setPixelColor(0, pixels.Color(12, 66, 101));
pixels.show();
delay(400);
}
}