does this look right?

Do you have a question on how to do something.
Ask in here.
Post Reply
Lionfan
Posts: 166
Joined: Wed Nov 26, 2014 8:53 am

does this look right?

Post 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);
Image
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: does this look right?

Post 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);
Lionfan
Posts: 166
Joined: Wed Nov 26, 2014 8:53 am

Re: does this look right?

Post 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
Image
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: does this look right?

Post by cosmith71 »

I think pretty much everyone who has ever tried to do this has made this mistake, myself included. :D

--Colin
Post Reply