lnevo wrote:I like the second one. It should work although i believe ph would be 835 and assuming you called the function to get the ph...
I believe 00warpig is doing similar based on salinity..
Yes I do this exact thing with my Salinitiy probe to choose whether I am topping off from an ATO with Saltwater or Fresh water. I imagine the concept is identical for PH but you need to change a few little details.
My code regarding this is below
Add to the INCLUDES/Variable Declarations (Modify accordingly for PH and default relay port)
Code: Select all
//*****Begin ATO By Salinity Additions
byte ATOBrutePort = Port2;
//*****End ATO By Salinity Additions
Add to the loop (Modify accordingly for PH and required relay ports)
Code: Select all
//*****Begin ATO By Salinity Additions
if (ReefAngel.Params.Salinity<300)
{
ATOBrutePort=Port7;
}
else
{
ATOBrutePort=Port2;
}
ReefAngel.StandardATO(ATOBrutePort,40 );
if (iochannel2flag == 1)
{
ReefAngel.Relay.RelayMaskOff=~(Port7Bit);
}
if (iochannel4flag == 1)
{
ReefAngel.Relay.RelayMaskOff=~(Port2Bit);
}
//*****End ATO By Salinity Additions
Obviously this is for salinity and choosing ATO container by salinity probe reading but the concept should be identical with minimal modification to the code above.
ohh and you may not need the "if (iochannel2flag == 1)" and " if (iochannel4flag == 1)" IF/THEN statements. I have a float switch in the bottom of each of my ATO containers to prevent them from pumping water in the event of that container being empty.
One more thing... I also added this to my loop so I can use the portal or the android app to check which ATO port would be the selected one at any point in time. My portal/android says "ATO RO(2) SW(7)" so if the number displayed is 2 my current ATO is RO if the number displayed is 7 my ATO would fill with SW based on the probe reading at that very moment.
Code: Select all
ReefAngel.CustomVar[7]=ATOBrutePort;
Nick