/*
This sketch is the model for an LED Hourglass.
- 12 leds at 5 seconds each = 1 minute.
- 10 leds at 1 minute each = 10 minutes.
- 6 leds at 10 minutes each = 1 hour.
- 12 leds at 1 hour each = 12 hours.

May need to create a library to keep sketch manageable
*/


// minute led group
const byte led1 = 2;
const byte led2 = 3;
const byte led3 = 4;
const byte led4 = 5;
const byte led5 = 6;
const byte led6 = 7;
const byte led7 = 8;
const byte led8 = 9;
const byte led9 = 10;
const byte led10 = 11;
const byte led11 = 12;
const byte led12 = 13;

// ten minute led group
const byte led13 = 22;
const byte led14 = 23;
const byte led15 = 24;
const byte led16 = 25;
const byte led17 = 26;
const byte led18 = 27;
const byte led19 = 28;
const byte led20 = 29;
const byte led21 = 30;
const byte led22 = 31;

// one hour led group
const byte led23 = 32;
const byte led24 = 33;
const byte led25 = 34;
const byte led26 = 35;
const byte led27 = 36;
const byte led28 = 37;

// twelve hour led group
const byte led29 = 38;
const byte led30 = 39;
const byte led31 = 40;
const byte led32 = 41;
const byte led33 = 42;
const byte led34 = 43;
const byte led35 = 44;
const byte led36 = 45;
const byte led37 = 46;
const byte led38 = 47;
const byte led39 = 48;
const byte led40 = 49;

// minute event group
unsigned long event1 = 5000UL;    // 5 sec
unsigned long event2 = 10000UL;   // 10 sec
unsigned long event3 = 15000UL;   // 15 sec
unsigned long event4 = 20000UL;
unsigned long event5 = 25000UL;
unsigned long event6 = 30000UL;
unsigned long event7 = 35000UL;
unsigned long event8 = 40000UL;
unsigned long event9 = 45000UL;
unsigned long event10 = 50000UL;
unsigned long event11 = 55000UL;  // 55 sec

// ten minute event group
unsigned long event12 = 60000UL;  // 1 min
unsigned long event13 = 120000UL; // 2 min 
unsigned long event14 = 180000UL; // 3 min
unsigned long event15 = 240000UL;
unsigned long event16 = 300000UL;
unsigned long event17 = 360000UL;
unsigned long event18 = 420000UL;
unsigned long event19 = 480000UL;
unsigned long event20 = 540000UL; // 9 min

// one hour event group
unsigned long event21 = 600000UL; // 10 min
unsigned long event22 = 1200000UL; // 20 min
unsigned long event23 = 1800000UL; // 30 min
unsigned long event24 = 2400000UL; // 40 min
unsigned long event25 = 3000000UL; // 50 min

// 12 hour event group
unsigned long event26 = 3600000UL; // 1 hour
unsigned long event27 = 7200000UL; // 2 hour
unsigned long event28 = 10800000UL; // 3 hour
unsigned long event29 = 14400000UL; // 4 hour
unsigned long event30 = 18000000UL; // 5 hour
unsigned long event31 = 21600000UL; // 6 hour
unsigned long event32 = 25200000UL; // 7 hour
unsigned long event33 = 28800000UL; // 8 hour
unsigned long event34 = 32400000UL; // 9 hour
unsigned long event35 = 36000000UL; // 10 hour
unsigned long event36 = 39600000UL; // 11 hour
unsigned long event37 = 43200000UL; // 12 hour

// minute previousTime group
unsigned long previousTime1 = 0;
unsigned long previousTime2 = 0;
unsigned long previousTime3 = 0;
unsigned long previousTime4 = 0;
unsigned long previousTime5 = 0;
unsigned long previousTime6 = 0;
unsigned long previousTime7 = 0;
unsigned long previousTime8 = 0;
unsigned long previousTime9 = 0;
unsigned long previousTime10 = 0;
unsigned long previousTime11 = 0;

// ten minute previousTime group
unsigned long previousTime12 = 0;
unsigned long previousTime13 = 0;
unsigned long previousTime14 = 0;
unsigned long previousTime15 = 0;
unsigned long previousTime16 = 0;
unsigned long previousTime17 = 0;
unsigned long previousTime18 = 0;
unsigned long previousTime19 = 0;
unsigned long previousTime20 = 0;

// one hour previousTime group
unsigned long previousTime21 = 0;
unsigned long previousTime22 = 0;
unsigned long previousTime23 = 0;
unsigned long previousTime24 = 0;
unsigned long previousTime25 = 0;

// twelve hour previousTime group
unsigned long previousTime26 = 0;
unsigned long previousTime27 = 0;
unsigned long previousTime28 = 0;
unsigned long previousTime29 = 0;
unsigned long previousTime30 = 0;
unsigned long previousTime31 = 0;
unsigned long previousTime32 = 0;
unsigned long previousTime33 = 0;
unsigned long previousTime34 = 0;
unsigned long previousTime35 = 0;
unsigned long previousTime36 = 0;
unsigned long previousTime37 = 0;

void setup() {
  Serial.begin(9600);
  // one minute led group
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);
  pinMode(led7, OUTPUT);
  pinMode(led8, OUTPUT);
  pinMode(led9, OUTPUT);
  pinMode(led10, OUTPUT);
  pinMode(led11, OUTPUT);
  pinMode(led12, OUTPUT);
  // ten minute led group
  pinMode(led13, OUTPUT);
  pinMode(led14, OUTPUT);
  pinMode(led15, OUTPUT);
  pinMode(led16, OUTPUT);
  pinMode(led17, OUTPUT);
  pinMode(led18, OUTPUT);
  pinMode(led19, OUTPUT);
  pinMode(led20, OUTPUT);
  pinMode(led21, OUTPUT);
  pinMode(led22, OUTPUT);
  // one hour led group
  pinMode(led23, OUTPUT);
  pinMode(led24, OUTPUT);
  pinMode(led25, OUTPUT);
  pinMode(led26, OUTPUT);
  pinMode(led27, OUTPUT);
  pinMode(led28, OUTPUT);
  // twelve hour led group
  pinMode(led29, OUTPUT);
  pinMode(led30, OUTPUT);
  pinMode(led31, OUTPUT);
  pinMode(led32, OUTPUT);
  pinMode(led33, OUTPUT);
  pinMode(led34, OUTPUT);
  pinMode(led35, OUTPUT);
  pinMode(led36, OUTPUT);
  pinMode(led37, OUTPUT);
  pinMode(led38, OUTPUT);
  pinMode(led39, OUTPUT);
  pinMode(led40, OUTPUT);
}

void loop() {
  unsigned long currentTime = millis(); // continuously updated
  Serial.print("currentTime = "); Serial.println(currentTime);

  // - - - - - 1 minuute led group - - - - -
  // - - - - - 1st 5 sec - - - - -
  if (currentTime - previousTime1 >= event1) { // currentTime(5000) - 0 >= 5000, run code
    // previousTime1 will be 5000(5 sec), 65000(1 min - 5 sec), 125000(2 min - 5 sec), 185000
    previousTime1 = currentTime; 
    Serial.print("previousTime1: "); Serial.println(previousTime1);
    // event will run again at 65000 currentTime (1min, 5sec), 65000 - previousTime1 5000 >= 60000
    // event will run again at 125000 currentTime (2min, 5sec), 125000 - previouseTime1 65000 >= 60000
    event1 = 60000UL; 
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    delay(100);
    digitalWrite(led7, LOW);
    digitalWrite(led8, HIGH);
    delay(100);
    digitalWrite(led8, LOW);
    digitalWrite(led9, HIGH);
    delay(100);
    digitalWrite(led9, LOW);
    digitalWrite(led10, HIGH);
    delay(100);
    digitalWrite(led10, LOW);
    digitalWrite(led11, HIGH);
    delay(100);
    digitalWrite(led11, LOW);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 2nd 5 sec - - - - -
  if (currentTime - previousTime2 >= event2) { // currentTime(10000) - 0 >= 10000, run code
    previousTime2 = currentTime; // previousTime2 is now 10000
    Serial.print("previousTime2: "); Serial.println(previousTime2);
    event2 = 60000UL; // event will run again at 70000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    delay(100);
    digitalWrite(led7, LOW);
    digitalWrite(led8, HIGH);
    delay(100);
    digitalWrite(led8, LOW);
    digitalWrite(led9, HIGH);
    delay(100);
    digitalWrite(led9, LOW);
    digitalWrite(led10, HIGH);
    delay(100);
    digitalWrite(led10, LOW);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 3rd 5 sec - - - - - -
  if (currentTime - previousTime3 >= event3) { // currentTime(15000) - 0 >= 15000, run code
    previousTime3 = currentTime; // previousTime3 is now 15000
    Serial.print("previousTime3: "); Serial.println(previousTime3);
    event3 = 60000UL; // event will run again at 75000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    delay(100);
    digitalWrite(led7, LOW);
    digitalWrite(led8, HIGH);
    delay(100);
    digitalWrite(led8, LOW);
    digitalWrite(led9, HIGH);
    delay(100);
    digitalWrite(led9, LOW);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 4th 5 sec - - - - - -
  if (currentTime - previousTime4 >= event4) { // currentTime(20000) - 0 >= 20000, run code
    previousTime4 = currentTime; // previousTime4 is now 20000
    Serial.print("previousTime4: "); Serial.println(previousTime4);
    event4 = 60000UL; // event will run again at 80000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    delay(100);
    digitalWrite(led7, LOW);
    digitalWrite(led8, HIGH);
    delay(100);
    digitalWrite(led8, LOW);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 5th 5 sec - - - - - -
  if (currentTime - previousTime5 >= event5) { // currentTime(25000) - 0 >= 25000, run code
    previousTime5 = currentTime; // previousTime5 is now 25000
    Serial.print("previousTime5: "); Serial.println(previousTime5);
    event5 = 60000UL; // event will run again at 85000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    delay(100);
    digitalWrite(led7, LOW);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 6th 5 sec - - - - - -
  if (currentTime - previousTime6 >= event6) { // currentTime(30000) - 0 >= 30000, run code
    previousTime6 = currentTime; // previousTime6 is now 30000
    Serial.print("previousTime6: "); Serial.println(previousTime6);
    event6 = 60000UL; // event will run again at 90000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    delay(100);
    digitalWrite(led6, LOW);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 7th 5 sec - - - - - -
  if (currentTime - previousTime7 >= event7) { // currentTime(35000) - 0 >= 35000, run code
    previousTime7 = currentTime; // previousTime7 is now 35000
    Serial.print("previousTime7: "); Serial.println(previousTime7);
    event7 = 60000UL; // event will run again at 95000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    delay(100);
    digitalWrite(led5, LOW);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 8th 5 sec - - - - - -
  if (currentTime - previousTime8 >= event8) { // currentTime(40000) - 0 >= 40000, run code
    previousTime8 = currentTime; // previousTime8 is now 40000
    Serial.print("previousTime8: "); Serial.println(previousTime8);
    event8 = 60000UL; // event will run again at 100000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    delay(100);
    digitalWrite(led4, LOW);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 9th 5 sec - - - - - -
  if (currentTime - previousTime9 >= event9) { // currentTime(45000) - 0 >= 45000, run code
    previousTime9 = currentTime; // previousTime9 is now 45000
    Serial.print("previousTime9: "); Serial.println(previousTime9);
    event9 = 60000UL; // event will run again at 105000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    delay(100);
    digitalWrite(led3, LOW);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 10th 5 sec - - - - - -
  if (currentTime - previousTime10 >= event10) { // currentTime(50000) - 0 >= 50000, run code
    previousTime10 = currentTime; // previousTime10 is now 50000
    Serial.print("previousTime10: "); Serial.println(previousTime10);
    event10 = 60000UL; // event will run again at 110000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(100);
    digitalWrite(led2, LOW);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 1 minuute led group - - - - -
  // - - - - - 11th 5 sec - - - - - -
  if (currentTime - previousTime11 >= event11) { // currentTime(55000) - 0 >= 55000, run code
    previousTime11 = currentTime; // previousTime11 is now 55000
    Serial.print("previousTime11: "); Serial.println(previousTime11);
    event11 = 60000UL; // event will run again at 115000 CT
    digitalWrite(led1, HIGH);
    delay(100);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 1st min - - - - - -
  if (currentTime - previousTime12 >= event12) { // currentTime(60000) - 0 >= 60000, run code
    // previousTime12 will be 60000(1 min), 660000(11 min), 1260000(21 min), 1860000(31 min)
    previousTime12 = currentTime; // previousTime12 is now 60000
    Serial.print("previousTime12: "); Serial.println(previousTime12);
    // event will run again at 660000 currentTime (11 min), 660000 - previousTime12 60000 >= 600000
    // event will run again at 1260000 currentTime (21 min), 1260000 - previousTime12 660000 >= 600000
    // event will run again at 1860000 currentTime (31 min), 1860000 - previouseTime12 1260000 >= 600000
    event12 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }
    
    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    delay(100);
    digitalWrite(led17, LOW);
    digitalWrite(led18, HIGH);
    delay(100);
    digitalWrite(led18, LOW);
    digitalWrite(led19, HIGH);
    delay(100);
    digitalWrite(led19, LOW);
    digitalWrite(led20, HIGH);
    delay(100);
    digitalWrite(led20, LOW);
    digitalWrite(led21, HIGH);
    delay(100);
    digitalWrite(led21, LOW);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 2nd min - - - - - -
  if (currentTime - previousTime13 >= event13) { // currentTime(120000) - 0 >= 120000, run code
    previousTime13 = currentTime; // previousTime13 is now 120000
    Serial.print("previousTime13: "); Serial.println(previousTime13);
    event13 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    delay(100);
    digitalWrite(led17, LOW);
    digitalWrite(led18, HIGH);
    delay(100);
    digitalWrite(led18, LOW);
    digitalWrite(led19, HIGH);
    delay(100);
    digitalWrite(led19, LOW);
    digitalWrite(led20, HIGH);
    delay(100);
    digitalWrite(led20, LOW);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 3rd min - - - - - -
  if (currentTime - previousTime14 >= event14) { // currentTime(180000) - 0 >= 180000, run code
    previousTime14 = currentTime; // previousTime14 is now 180000
    Serial.print("previousTime14: "); Serial.println(previousTime14);
    event14 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    delay(100);
    digitalWrite(led17, LOW);
    digitalWrite(led18, HIGH);
    delay(100);
    digitalWrite(led18, LOW);
    digitalWrite(led19, HIGH);
    delay(100);
    digitalWrite(led19, LOW);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 4th min - - - - - -
  if (currentTime - previousTime15 >= event15) { // currentTime(240000) - 0 >= 240000, run code
    previousTime15 = currentTime; // previousTime15 is now 240000
    Serial.print("previousTime15: "); Serial.println(previousTime15);
    event15 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    delay(100);
    digitalWrite(led17, LOW);
    digitalWrite(led18, HIGH);
    delay(100);
    digitalWrite(led18, LOW);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 5th min - - - - - -
  if (currentTime - previousTime16 >= event16) { // currentTime(300000) - 0 >= 300000, run code
    previousTime16 = currentTime; // previousTime16 is now 300000
    Serial.print("previousTime16: "); Serial.println(previousTime16);
    event16 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    delay(100);
    digitalWrite(led17, LOW);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 6th min - - - - - -
  if (currentTime - previousTime17 >= event17) { // currentTime(360000) - 0 >= 360000, run code
    previousTime17 = currentTime; // previousTime17 is now 360000
    Serial.print("previousTime17: "); Serial.println(previousTime17);
    event17 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    delay(100);
    digitalWrite(led16, LOW);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 7th min - - - - - -
  if (currentTime - previousTime18 >= event18) { // currentTime(420000) - 0 >= 420000, run code
    previousTime18 = currentTime; // previousTime18 is now 420000
    Serial.print("previousTime18: "); Serial.println(previousTime18);
    event18 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    delay(100);
    digitalWrite(led15, LOW);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 8th min - - - - - -
  if (currentTime - previousTime19 >= event19) { // currentTime(480000) - 0 >= 480000, run code
    previousTime19 = currentTime; // previousTime19 is now 480000
    Serial.print("previousTime19: "); Serial.println(previousTime19);
    event19 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    delay(100);
    digitalWrite(led14, LOW);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 10 minuute led group - - - - -
  // - - - - - 9th min - - - - - -
  if (currentTime - previousTime20 >= event20) { // currentTime(540000) - 0 >= 540000, run code
    previousTime20 = currentTime; // previousTime20 is now 540000
    Serial.print("previousTime20: "); Serial.println(previousTime20);
    event20 = 600000UL;
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led13, HIGH);
    delay(100);
    digitalWrite(led13, LOW);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 1 hour led group - - - - -
  // - - - - - 1st 10 min - - - - - -
  if (currentTime - previousTime21 >= event21) { // currentTime(600000) - 0 >= 600000, run code
    // previousTime21 will be 600000(10 min), 4200000(1 hr 10 min), 7800000(2 hr 10 min)
    previousTime21 = currentTime; // previousTime21 is now 600000
    // event will run again at 4200000 currentTime (1 hr 10 min), 4200000 - previousTime21 600000 >= 3600000
    // event will run again at 7800000 currentTime (2 hr 10 min), 7800000 - previousTime21 4200000 >= 3600000
    // event will run again at 11400000 currentTime (3 hr 10 min), 11400000 - previouseTime21 7800000 >= 3600000
    event21 = 3600000UL; // 3600000 = 1 hour
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, HIGH);
    }
    
    // all on, 10 minute led group
    for (byte i = 22; i <= 31; i++) {
      digitalWrite(i, HIGH);
    }

    digitalWrite(led23, HIGH);
    delay(100);
    digitalWrite(led23, LOW);
    digitalWrite(led24, HIGH);
    delay(100);
    digitalWrite(led24, LOW);
    digitalWrite(led25, HIGH);
    delay(100);
    digitalWrite(led25, LOW);
    digitalWrite(led26, HIGH);
    delay(100);
    digitalWrite(led26, LOW);
    digitalWrite(led27, HIGH);
    delay(100);
    digitalWrite(led27, LOW);
    digitalWrite(led28, HIGH);
  
    // turn off 10 minute group leds
    for (byte i = 22; i <= 31; i++) {
      digitalWrite(i, LOW);
    }

    // turn off 1 minute group leds
    for (byte i = 2; i <= 13; i++) {
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 1 hour led group - - - - -
  // - - - - - 2nd 10 min - - - - - -
  if (currentTime - previousTime22 >= event22) { // currentTime(1200000) - 0 >= 1200000, run code
    previousTime22 = currentTime; // previousTime22 is now 1200000
    event22 = 3600000UL;
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    digitalWrite(led23, HIGH);
    delay(100);
    digitalWrite(led23, LOW);
    digitalWrite(led24, HIGH);
    delay(100);
    digitalWrite(led24, LOW);
    digitalWrite(led25, HIGH);
    delay(100);
    digitalWrite(led25, LOW);
    digitalWrite(led26, HIGH);
    delay(100);
    digitalWrite(led26, LOW);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 1 hour led group - - - - -
  // - - - - - 3rd 10 min - - - - - -
  if (currentTime - previousTime23 >= event23) { // currentTime(1800000) - 0 >= 1800000, run code
    previousTime23 = currentTime; // previousTime23 is now 1800000
    event23 = 3600000UL;
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    digitalWrite(led23, HIGH);
    delay(100);
    digitalWrite(led23, LOW);
    digitalWrite(led24, HIGH);
    delay(100);
    digitalWrite(led24, LOW);
    digitalWrite(led25, HIGH);
    delay(100);
    digitalWrite(led25, LOW);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 1 hour led group - - - - -
  // - - - - - 4th 10 min - - - - - -
  if (currentTime - previousTime24 >= event24) { // currentTime(2400000) - 0 >= 2400000, run code
    previousTime24 = currentTime; // previousTime24 is now 2400000
    event24 = 3600000UL;
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    digitalWrite(led23, HIGH);
    delay(100);
    digitalWrite(led23, LOW);
    digitalWrite(led24, HIGH);
    delay(100);
    digitalWrite(led24, LOW);
    digitalWrite(led25, HIGH);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 1 hour led group - - - - -
  // - - - - - 5th 10 min - - - - - -
  if (currentTime - previousTime25 >= event25) { // currentTime(3000000) - 0 >= 3000000, run code
    previousTime25 = currentTime; // previousTime25 is now 3000000
    event25 = 3600000UL;
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    digitalWrite(led23, HIGH);
    delay(100);
    digitalWrite(led23, LOW);
    digitalWrite(led24, HIGH);
    digitalWrite(led25, HIGH);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 1st hour - - - - - -
  if (currentTime - previousTime26 >= event26) { // currentTime(3600000) - 0 >= 3600000, run code
    previousTime26 = currentTime; // previousTime26 is now 3600000
    event26 = 43200000UL; // 43200000 = 12 hour
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // all on, 1 hour led group
    digitalWrite(led23, HIGH);
    digitalWrite(led24, HIGH);
    digitalWrite(led25, HIGH);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    delay(100);
    digitalWrite(led35, LOW);
    digitalWrite(led36, HIGH);
    delay(100);
    digitalWrite(led36, LOW);
    digitalWrite(led37, HIGH);
    delay(100);
    digitalWrite(led37, LOW);
    digitalWrite(led38, HIGH);
    delay(100);
    digitalWrite(led38, LOW);
    digitalWrite(led39, HIGH);
    delay(100);
    digitalWrite(led39, LOW);
    digitalWrite(led40, HIGH);

    // turn off 1 hour group leds
    digitalWrite(led23, LOW);
    digitalWrite(led24, LOW);
    digitalWrite(led25, LOW);
    digitalWrite(led26, LOW);
    digitalWrite(led27, LOW);
    digitalWrite(led28, LOW);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 2nd hour - - - - - -
  if (currentTime - previousTime27 >= event27) { // currentTime(7200000) - 0 >= 7200000, run code
    previousTime27 = currentTime; // previousTime27 is now 7200000
    event27 = 43200000UL; // 43200000 = 12 hour
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // all on, 1 hour led group
    digitalWrite(led23, HIGH);
    digitalWrite(led24, HIGH);
    digitalWrite(led25, HIGH);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    delay(100);
    digitalWrite(led35, LOW);
    digitalWrite(led36, HIGH);
    delay(100);
    digitalWrite(led36, LOW);
    digitalWrite(led37, HIGH);
    delay(100);
    digitalWrite(led37, LOW);
    digitalWrite(led38, HIGH);
    delay(100);
    digitalWrite(led38, LOW);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);

    // turn off 1 hour group leds
    digitalWrite(led23, LOW);
    digitalWrite(led24, LOW);
    digitalWrite(led25, LOW);
    digitalWrite(led26, LOW);
    digitalWrite(led27, LOW);
    digitalWrite(led28, LOW);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 3rd hour - - - - - -
  if (currentTime - previousTime28 >= event28) { // currentTime(10800000) - 0 >= 10800000, run code
    previousTime28 = currentTime; // previousTime28 is now 10800000
    event28 = 43200000UL; // 43200000 = 12 hour
    // all on, 1 minute led group
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    digitalWrite(led5, HIGH);
    digitalWrite(led6, HIGH);
    digitalWrite(led7, HIGH);
    digitalWrite(led8, HIGH);
    digitalWrite(led9, HIGH);
    digitalWrite(led10, HIGH);
    digitalWrite(led11, HIGH);
    digitalWrite(led12, HIGH);

    // all on, 10 minute led group
    digitalWrite(led13, HIGH);
    digitalWrite(led14, HIGH);
    digitalWrite(led15, HIGH);
    digitalWrite(led16, HIGH);
    digitalWrite(led17, HIGH);
    digitalWrite(led18, HIGH);
    digitalWrite(led19, HIGH);
    digitalWrite(led20, HIGH);
    digitalWrite(led21, HIGH);
    digitalWrite(led22, HIGH);

    // all on, 1 hour led group
    digitalWrite(led23, HIGH);
    digitalWrite(led24, HIGH);
    digitalWrite(led25, HIGH);
    digitalWrite(led26, HIGH);
    digitalWrite(led27, HIGH);
    digitalWrite(led28, HIGH);

    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    delay(100);
    digitalWrite(led35, LOW);
    digitalWrite(led36, HIGH);
    delay(100);
    digitalWrite(led36, LOW);
    digitalWrite(led37, HIGH);
    delay(100);
    digitalWrite(led37, LOW);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);

    // turn off 1 hour group leds
    digitalWrite(led23, LOW);
    digitalWrite(led24, LOW);
    digitalWrite(led25, LOW);
    digitalWrite(led26, LOW);
    digitalWrite(led27, LOW);
    digitalWrite(led28, LOW);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 4th hour - - - - - -
  if (currentTime - previousTime29 >= event29) { // currentTime(14400000) - 0 >= 14400000, run code
    previousTime29 = currentTime; // previousTime29 is now 14400000
    event29 = 43200000UL; // 43200000 = 12 hour
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) { // led1 - led12, pins 2 - 13
      digitalWrite(i, HIGH);
    }

    // all on, 10 minute led group
    for (byte i = 22; i <= 31; i++) { // led13 - led22, pins 22 - 31
      digitalWrite(i, HIGH);
    }

    // all on, 1 hour led group
    for (byte i = 32; i <= 37; i++) { // led23 - led28, pins 32 - 37
      digitalWrite(i, HIGH);
    }

    // 12 hour led group
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    delay(100);
    digitalWrite(led35, LOW);
    digitalWrite(led36, HIGH);
    delay(100);
    digitalWrite(led36, LOW);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);

    // turn off, 1 hour led group
    for (byte i = 32; i <= 37; i++) { // led23 - led28, pins 32 - 37
      digitalWrite(i, LOW);
    }

    // turn off, 10 minute led group
    for (byte i = 22; i <= 31; i++) { // led13 - led22, pins 22 - 31
      digitalWrite(i, LOW);
    }

    // turn off, 1 minute led group
    for (byte i = 2; i <= 13; i++) { // led1 - led12, pins 2 - 13
      digitalWrite(i, LOW);
    }
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 5th hour - - - - - -
  if (currentTime - previousTime30 >= event30) { // currentTime(18000000) - 0 >= 18000000, run code
    previousTime30 = currentTime; // previousTime30 is now 18000000
    event30 = 43200000UL; // 43200000 = 12 hour
    // all on, 1 minute led group
    for (byte i = 2; i <= 13; i++) { // led1 - led12, pins 2 - 13
      digitalWrite(i, HIGH);
    }

    // all on, 10 minute led group
    for (byte i = 22; i <= 31; i++) { // led13 - led22, pins 22 - 31
      digitalWrite(i, HIGH);
    }

    // all on, 1 hour led group
    for (byte i = 32; i <= 37; i++) { // led23 - led28, pins 32 - 37
      digitalWrite(i, HIGH);
    }

    // 12 hour led group
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    delay(100);
    digitalWrite(led35, LOW);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);

    // turn off 1 hour group leds
    digitalWrite(led23, LOW);
    digitalWrite(led24, LOW);
    digitalWrite(led25, LOW);
    digitalWrite(led26, LOW);
    digitalWrite(led27, LOW);
    digitalWrite(led28, LOW);

    // turn off 10 minute group leds
    digitalWrite(led13, LOW);
    digitalWrite(led14, LOW);
    digitalWrite(led15, LOW);
    digitalWrite(led16, LOW);
    digitalWrite(led17, LOW);
    digitalWrite(led18, LOW);
    digitalWrite(led19, LOW);
    digitalWrite(led20, LOW);
    digitalWrite(led21, LOW);
    digitalWrite(led22, LOW);

    // turn off 1 minute group leds
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    digitalWrite(led5, LOW);
    digitalWrite(led6, LOW);
    digitalWrite(led7, LOW);
    digitalWrite(led8, LOW);
    digitalWrite(led9, LOW);
    digitalWrite(led10, LOW);
    digitalWrite(led11, LOW);
    digitalWrite(led12, LOW);
  }


  // * * * * * * * CODE BELOW NEEDS TO BE FINISHED * * * * * * *
/*
  // - - - - - 12 hour led group - - - - -
  // - - - - - 6th hour - - - - - -
  if (currentTime - previousTime34 >= event34) { // currentTime(21600000) - 0 >= 21600000, run code
    previousTime34 = currentTime; // previousTime34 is now 21600000
    event34 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    delay(100);
    digitalWrite(led34, LOW);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 7th hour - - - - - -
  if (currentTime - previousTime35 >= event35) { // currentTime(25200000) - 0 >= 25200000, run code
    previousTime35 = currentTime; // previousTime35 is now 25200000
    event35 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    delay(100);
    digitalWrite(led33, LOW);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 8th hour - - - - - -
  if (currentTime - previousTime36 >= event36) { // currentTime(28800000) - 0 >= 28800000, run code
    previousTime36 = currentTime; // previousTime36 is now 28800000
    event36 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    delay(100);
    digitalWrite(led32, LOW);
    digitalWrite(led33, HIGH);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 9th hour - - - - - -
  if (currentTime - previousTime37 >= event37) { // currentTime(32400000) - 0 >= 32400000, run code
    previousTime37 = currentTime; // previousTime37 is now 32400000
    event37 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    delay(100);
    digitalWrite(led31, LOW);
    digitalWrite(led32, HIGH);
    digitalWrite(led33, HIGH);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 10th hour - - - - - -
  if (currentTime - previousTime38 >= event38) { // currentTime(36000000) - 0 >= 36000000, run code
    previousTime38 = currentTime; // previousTime38 is now 36000000
    event38 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    delay(100);
    digitalWrite(led30, LOW);
    digitalWrite(led31, HIGH);
    digitalWrite(led32, HIGH);
    digitalWrite(led33, HIGH);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 11th hour - - - - - -
  if (currentTime - previousTime39 >= event39) { // currentTime(39600000) - 0 >= 39600000, run code
    previousTime39 = currentTime; // previousTime39 is now 39600000
    event39 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    delay(100);
    digitalWrite(led29, LOW);
    digitalWrite(led30, HIGH);
    digitalWrite(led31, HIGH);
    digitalWrite(led32, HIGH);
    digitalWrite(led33, HIGH);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);
  }
  // - - - - - 12 hour led group - - - - -
  // - - - - - 12th hour - - - - - -
  if (currentTime - previousTime40 >= event40) { // currentTime(43200000) - 0 >= 43200000, run code
    previousTime40 = currentTime; // previousTime40 is now 43200000
    event40 = 43200000UL; // 43200000 = 12 hour
    digitalWrite(led29, HIGH);
    digitalWrite(led30, HIGH);
    digitalWrite(led31, HIGH);
    digitalWrite(led32, HIGH);
    digitalWrite(led33, HIGH);
    digitalWrite(led34, HIGH);
    digitalWrite(led35, HIGH);
    digitalWrite(led36, HIGH);
    digitalWrite(led37, HIGH);
    digitalWrite(led38, HIGH);
    digitalWrite(led39, HIGH);
    digitalWrite(led40, HIGH);

    delay(1000);

    digitalWrite(led29, LOW);
    digitalWrite(led30, LOW);
    digitalWrite(led31, LOW);
    digitalWrite(led32, LOW);
    digitalWrite(led33, LOW);
    digitalWrite(led34, LOW);
    digitalWrite(led35, LOW);
    digitalWrite(led36, LOW);
    digitalWrite(led37, LOW);
    digitalWrite(led38, LOW);
    digitalWrite(led39, LOW);
    digitalWrite(led40, LOW);
  }
*/





}