Page 1 of 1

does this look right?

Posted: Fri Jun 26, 2015 3:57 pm
by Lionfan
Decided to take a stab at coding dosing pumps.
Basically, my dosers come on every 30 minutes for 60 seconds.
I wanted my carbonate to come on at night, and be disabled during the day.
And calcuim to run during the day.

Code: Select all

            if ((hour() >= 8) && (hour() < 20))  // Between 8am and 8pm disable Port 8 (carbonate)
  ReefAngel.Relay.Off(Port8);
      if ((hour() <= 8) && (hour() > 20))  // Between 8pm and 8am disable Port 7 (calcuim)
  ReefAngel.Relay.Off(Port7);

Re: does this look right?

Posted: Fri Jun 26, 2015 4:11 pm
by cosmith71
The hour can't be less than 8 and greater than 20. Change to this:

Code: Select all

 if ((hour() < 8) || (hour() >= 20))  // Between 8pm and 8am disable Port 7 (calcuim)
  ReefAngel.Relay.Off(Port7);

Re: does this look right?

Posted: Sat Jun 27, 2015 6:50 am
by Lionfan
cosmith71 wrote:The hour can't be less than 8 and greater than 20. Change to this:

Code: Select all

 if ((hour() < 8) || (hour() >= 20))  // Between 8pm and 8am disable Port 7 (calcuim)
  ReefAngel.Relay.Off(Port7);
See, I knew that. Lol.
Thanks

Re: does this look right?

Posted: Sat Jun 27, 2015 6:58 am
by cosmith71
I think pretty much everyone who has ever tried to do this has made this mistake, myself included. :D

--Colin