Isn’t taking down and putting up Christmas lights a tedious process? Well, I thought so too, which is why I decided to combine two things in this project:
- my need for an all-year decoration for my backyard that I wouldn’t have to take down and
- my fascination and curiosity with smart led lights and the limitless possibilities surrounding them
#define PIN 2
#define NUM_PIX 200
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIX, PIN, NEO_RGB + NEO_KHZ800);
// Defining Colors
uint32_t magenta = strip.Color(255, 0, 255);
uint32_t yellow = strip.Color(150, 50, 0);
uint32_t n_yellow = strip.Color(0, 255, 0);
uint32_t green = strip.Color(0, 255, 0);
uint32_t red = strip.Color(255, 0, 0);
uint32_t spooky_orange = strip.Color(255, 46, 0);
uint32_t halloween_yellow = strip.Color(255, 72, 0);
uint32_t mom_cyan = strip.Color(0, 36, 27);
void setup()
{
strip.begin();
strip.show(); // Инициализация , все светодиоды выключены
}
void loop()
{
// runPix(25, 10);
// theaterChase(strip.Color(0, 36, ), 70); // Red old c=50
// halloweenPurpleOrange(10);
halloweenTime(10);
// halloweenPurple(10);
// RedYellowGreen();
// rainbow(100);
// theaterChase(yellow, 100);
// colorWipe(n_yellow, 100);
}
//FUNCTIONS
// alternating orange-yellow and orange lights
void halloweenTime(uint16_t n) { //n - rep amount
uint16_t i; // LED index
uint16_t j; // rep index
for (j=1; j<n; j++) {
for(i=0; i< strip.numPixels(); i=i+2) {
strip.setPixelColor(i, spooky_orange);
strip.setPixelColor(i+1, halloween_yellow);
}
strip.show();
delay(1000);
for(i=0; i< strip.numPixels(); i=i+2) {
strip.setPixelColor(i, halloween_yellow);
strip.setPixelColor(i+1, spooky_orange);
}
strip.show();
delay(1000);
}