What is the best way to code a port to run 3 times a week?
Re: What is the best way to code a port to run 3 times a wee
That did it. Thanks again.
Re: What is the best way to code a port to run 3 times a wee
I put this code in to turn on the solenoid for my RO/DI unit Monday, Wednesday and Friday on last Friday the 24th.
I just noticed that it only turned on on that Friday. It didn't turn on on Monday or Yesterday (Wednesday).
Is there another way to do multiple if conditions like Roberto suggested?
I just noticed that it only turned on on that Friday. It didn't turn on on Monday or Yesterday (Wednesday).
Is there another way to do multiple if conditions like Roberto suggested?
Code: Select all
//Flush RO/DI Membrane 3 times a week @ 9pm.
ReefAngel.Relay.Off(Main_RODI);
if (weekday()==dowMonday && hour()==21 && minute()<5)
ReefAngel.Relay.On(Main_RODI);
ReefAngel.Relay.Off(Main_RODI);
if (weekday()==dowWednesday && hour()==21 && minute()<5)
ReefAngel.Relay.On(Main_RODI);
ReefAngel.Relay.Off(Main_RODI);
if (weekday()==dowFriday && hour()==21 && minute()<10)
ReefAngel.Relay.On(Main_RODI);
Re: What is the best way to code a port to run 3 times a wee
You should have just one Off at the beginning of the if statements or they will override the previous ones
Roberto.
Re: What is the best way to code a port to run 3 times a wee
Ok. I guess that is what's been happening. Thanks.
Re: What is the best way to code a port to run 3 times a wee
It worked perfectly.
I had a test time yesterday at 9pm, which went off fine and then it went off again tonight, as well as the other port turned on at 9:05.
Thanks for all the help.
I learned a bunch with this.
I had a test time yesterday at 9pm, which went off fine and then it went off again tonight, as well as the other port turned on at 9:05.
Thanks for all the help.
I learned a bunch with this.