#include #define LED_PIN 6 #define LED_COUNT 4 Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); uint32_t off = strip.Color(0, 0, 0); int sw_pin = 2; int sw_status = 0; int delayval = 200; int longdelay = 1500; void setup() { strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) strip.show(); // Turn OFF all pixels ASAP strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255) pinMode(sw_pin, INPUT_PULLUP); Serial.begin(9600); } void loop() { sw_status = digitalRead(sw_pin); if (sw_status == 0){ strip.setPixelColor(1, 255, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(1, 0, 0, 0); //no light strip.show(); //display the color delay(delayval); strip.setPixelColor(1, 255, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(1, 0, 0, 0); //no light strip.show(); //display the color delay(delayval); strip.setPixelColor(1, 255, 0, 0); //red strip.show(); //display the color delay(delayval); colorWipe(strip.Color(0, 0, 255), 50); // Blue strip.fill(off, 0, 4); strip.show(); //display the color strip.setPixelColor(0, 0, 0, 0); //no light strip.show(); //display the color delay(delayval); colorWipe(strip.Color(0, 0, 255), 50); // Blue strip.fill(off, 0, 4); strip.show(); //display the color strip.setPixelColor(0, 0, 0, 0); //no light strip.show(); //display the color delay(delayval); colorWipe(strip.Color(0, 0, 255), 50); // Blue strip.fill(off, 0, 4); strip.show(); //display the color strip.setPixelColor(0, 255, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(0, 0, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(0, 255, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(0, 0, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(0, 255, 0, 0); //red strip.show(); //display the color delay(delayval); strip.setPixelColor(0, 0, 0, 0); //red strip.show(); //display the color delay(longdelay); } } void colorWipe(uint32_t color, int wait) { for(int i=0; i