Is it necessary to set a condition loop to detect the current time if set to the opening hours <= current hours <set off hours && set the opening minutes <= current minutes <set off minutes to turn on the relay otherwise turn off the relay? The What is the current interval for this scan?
Clock chips are generally interrupt output, such as DS12B887, every second has an interrupt output, use this signal can do what you want to do.
Do not need it, just set the timer interrupt on it
On the main program has been refreshed
Pay attention to judge when to separate
If ((openhour <= hour) && (hour