I am now getting confused with your concept...
According to me the concept is that you are having the RTC and EEPROM.
And there are 4 switch which are being used to set the RTC time.
Now once the RTC time has been set the other requirement is that user can enter the delay time which will be time from now it will make the relay on, and these delay will also enter by the user using the switch...
Once the user entered the delay, add that delay with current RTC time i.e. delay time+RTC time in EEPROM....
Now after that delay time completed you need to turn on the relay....
Now you are able to do that upto these part...
The problem is that you are asking is that when the relay has been turned on and then if the power failure occurs the relay should retrive it previous status before power failure....
So for that problem the solution is that once the relay has been ON, write 1 to EEPROM some location and at the start up of your code just read the value of that particular location in EEPROM, compare it with 1 if it is 1 then put the relay as ON other wise....
I hope I have understood ur concept correctly....
According to me the concept is that you are having the RTC and EEPROM.
And there are 4 switch which are being used to set the RTC time.
Now once the RTC time has been set the other requirement is that user can enter the delay time which will be time from now it will make the relay on, and these delay will also enter by the user using the switch...
Once the user entered the delay, add that delay with current RTC time i.e. delay time+RTC time in EEPROM....
Now after that delay time completed you need to turn on the relay....
Now you are able to do that upto these part...
The problem is that you are asking is that when the relay has been turned on and then if the power failure occurs the relay should retrive it previous status before power failure....
So for that problem the solution is that once the relay has been ON, write 1 to EEPROM some location and at the start up of your code just read the value of that particular location in EEPROM, compare it with 1 if it is 1 then put the relay as ON other wise....
I hope I have understood ur concept correctly....
Last edited: