Page 1 of 1

Basic On/Off Function?

Posted: Thu Oct 03, 2013 10:06 am
by kirkwood
Every 5.5 hours I want port 5 to turn on/off. The power only needs to be cut off for a couple seconds and then turn back on.

Re: Basic On/Off Function?

Posted: Thu Oct 03, 2013 10:11 am
by rimai
Try this:

Code: Select all

ReefAngel.Relay.Set(Port5,now()%19800==0);

Re: Basic On/Off Function?

Posted: Fri Oct 04, 2013 7:20 am
by kirkwood
1) So does Port 5 need to be listed as an "ALWAYS ON" port?

2) Do I paste the code in the custom code area?


Currently I have Port 5 set as an "ALWAYS ON" port and pasted the code in the custom code section. And now for some reason the default of Port 5 is to be OFF? So I have to mask it to turn it on. I figured that I'm doing something wrong.

Re: Basic On/Off Function?

Posted: Fri Oct 04, 2013 7:50 am
by rimai
You can remove the always on code if you want to. Leaving it won't do anything either... So your choice.
I misread your question. I thought you wanted the opposite :(
Try this then:

Code: Select all

ReefAngel.Relay.Set(Port5,now()%19800!=0);