Hi to all,

I am a novice in programming but I wish to design a 24-hour Clock/Timer that it could switch a relay alternatively on and off during two to four programmable periods, for instance:

1.- 06:00 to 10:00 on
2.- 10:00 to 14:30 off
3.- 14:30 to 22:00 on
4.- 22:00 to 06:30 off

Obviously, the fourth period is between two different days. I thought it was very easy with a 16F628A, a DS1307 and PICbasic but I have stopped in the PICbasic's subroutine to control when the clock is in the fourth period.

Please, any suggestion?

Happy New Year

Virolay