Page 1 of 1
Logic based on pH
Posted: Fri Jul 19, 2013 1:50 pm
by btorrenga
I want to run a function only if pH is less than 8.0. Is the proper way to do so something like the following syntax? I guess my question really is "how do I query pH?"
Code: Select all
if (ReefAngel.Params.PH() < 800)
ReefAngel.Relay.On(Box1_Port6;
else
ReefAngel.Relay.Off(Box1_Port6);
Re: Logic based on pH
Posted: Fri Jul 19, 2013 2:19 pm
by lnevo
Yes but there is a problem with that. The probes fluctuate a lot so it will flicker between 799-801 for instance changing every few ms. The logic you have will turn that port on and off a lot.
We have a function you can use similar to the heater function
ReefAngel.PHControl(relay, lowph, highph);
This will allow you to set a range for when it turns on to when it turns off.
This function turns the device on when ph <= lowph and off when ph >= highph
There is another function CO2Control that takes the same args but does the opposite.
Re: Logic based on pH
Posted: Fri Jul 19, 2013 3:15 pm
by btorrenga
Hmm, ok, I have some things to work through then.
When inputting values into the portal for pH on and off, would I enter 8, or 800? (or 8.3 and 830?)
Re: Logic based on pH
Posted: Fri Jul 19, 2013 4:05 pm
by lnevo
If you use the portal to set the values you need to call the function with just the relay argument.
I'm not sure the syntax in the portal