+bool checkLeapYear(int the_year) {
+ if (the_year % 4 != 0) return false;
+ if (the_year % 100 == 0 && the_year %400 != 0) return false;
+ if (the_year % 400 == 0) return true;
+ return true;bool dst = false;
+}
+
+void xmas() {
+ int daysUntil = 25 - day();
+ int Day1 = (daysUntil/10U) % 10;
+ int Day2 = (daysUntil/1U) % 10;
+ digitalWrite(loadPin, 0);
+ shiftOut(dataPin, clockPin, LSBFIRST, digits[Day2]); //right
+ shiftOut(dataPin, clockPin, LSBFIRST, digits[Day1]); //left
+ digitalWrite(loadPin, 1);
+ for(int a=0; a<20; a++) { // Repeat 10 times...
+ for(int b=0; b<3; b++) { // 'b' counts from 0 to 2...
+ strip.clear(); // Set all pixels in RAM to 0 (off)
+ for(int i=0; i<strip.numPixels(); i++) {
+ strip.setPixelColor(i, 255,223,0);
+ }
+ for(int c=b; c<strip.numPixels(); c += 3) {
+ strip.setPixelColor(c, 255,0,0); // Set pixel 'c' to value 'color'
+ }
+ for(int c=b+1; c<strip.numPixels()+1; c += 3) {
+ if (c>=strip.numPixels()) {
+ strip.setPixelColor(0, 0,255,0); // Set pixel 'c' to value 'color'
+ } else {
+ strip.setPixelColor(c, 0,255,0); // Set pixel 'c' to value 'color'
+ }
+ }
+ strip.show(); // Update strip with new contents
+ delay(100); // Pause for a moment
+ }
+ }
+}
+