That's going to turn port 8 off for 3 minutes at 3,9,15 and 21 hours.
This is an easy to understand code:
Code: Select all
ReefAngel.Relay.On(Port8);
if (hour()==03) ReefAngel.Relay.Off(Port8);
if (hour()==04) ReefAngel.Relay.Off(Port8);
if (hour()==05) ReefAngel.Relay.Off(Port8);
So, it would turn off for the full hour of hour 3,4 and 5.
Then you can go and repeat for the other hours you would like.
But, a more compact code that would do what you want would be:
Code: Select all
ReefAngel.Relay.Set(Port8, now()%21600<10800);
The code above would make port 8 turn on for 3 hours and off for 3 hours. Just a little bit harder to understand without some math knowledge behind it, but both would work for what you want. Different ways of coding.
Roberto.