Scheduled chicken feeder

Can someone help me with my program because its not working once i uploaded it…

#include <TimeLib.h>
#include <DS3231.h>
#include <Servo.h> 

Servo servo1;
Servo servo2;
Time t;
int pos = 0;

// Init the DS3231 using the hardware interface
DS3231  rtc(SDA, SCL);

void setup()
{
  // Setup Serial connection
  Serial.begin(9600);
  // Uncomment the next line if you are using an Arduino Leonardo
  //while (!Serial) {}
  
  // Initialize the rtc object
  rtc.begin();
  
  // The following lines can be uncommented to set the date and time
  rtc.setDOW(MONDAY);     
   rtc.setTime(5, 0, 00);
  rtc.setDate(03, 05, 2021);   
  
servo1.attach(6);
  servo2.attach(9);
}

void loop()
{
  t = rtc.getTime();
  // Send Day-of-Week
  Serial.print(rtc.getDOWStr());
  Serial.print(" ");
  
  // Send date
  Serial.print(rtc.getTimeStr());
  Serial.print(" -- ");

  // Send time
  Serial.println(rtc.getDateStr());
  
  // Wait one second before repeating 
  delay (1000);
  {
 if ((rtc.getTimeStr() >= 5)) { 
  { for (pos = 0; pos <= 180; pos += 1) { 
    servo1.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo1.write(pos);              
    delay(2000);                       
  }
}
else if ((rtc.getTimeStr() >= 10)) { 
for (pos = 0; pos <= 180; pos += 1) { 
    
    servo1.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo1.write(pos);              
    delay(2000);                       
  }
}

else if ((rtc.getTimeStr() >= 13)) { for (pos = 0; pos <= 180; pos += 1) { 
    
    servo1.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo1.write(pos);              
    delay(2000);                       
  }
}
 else if ((rtc.getTimeStr() >= 16)) {
 for (pos = 0; pos <= 180; pos += 1) { 
    
    servo1.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo1.write(pos);              
    delay(2000);                       
  }
}


 if ((rtc.getTimeStr() >= 5)) { 
for (pos = 0; pos <= 180; pos += 1) { 
    
    servo2.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo1.write(pos);              
    delay(2000);                       
  }
}

else if ((rtc.getTimeStr() >= 10)) { 
for (pos = 0; pos <= 180; pos += 1) { 
    
    servo2.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo2.write(pos);              
    delay(2000);                       
  }
}

else if ((rtc.getTimeStr() >= 13)) { for (pos = 0; pos <= 180; pos += 1) { 
    
    servo2.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo2.write(pos);              
    delay(2000);                       
  }
}


else if ((rtc.getTimeStr() >= 16)) { for (pos = 0; pos <= 180; pos += 1) { 
    
    servo2.write(pos);              
    delay(5000);                       
  }
  
for (pos = 180; pos >= 0; pos -= 1) { 
    servo2.write(pos);              
    delay(2000);                       
  }
}
  

  }  }

A post was merged into an existing topic: Automatic Chicken Feeder