Automatic Timer Chicken Coop Door with L298N Driver And ds1307

Legend_ary:
Well you are correct but when I set desired time to go up or down it wont raise or close door at that time so thats the problem

In your code, you have this:

// Time represents just hour/min and time = hour * 60 + min
int raiseTime = 1378; // 7:10
int lowerTime = 1377; // 18:50

But 1378 is 10:58PM, not 7:10. And since your raise time is greater than your lower time, this condition

raiseTime <= timeNow && timeNow < lowerTime

will never be true.

Why not

// Time represents just hour/min and time = hour * 60 + min
int raiseTime = 7 * 60 + 10 ; // 7:10
int lowerTime = raiseTime + 5;  // raise for 5 minutes