Hi guys, I have the following code for my waterlevel expansion:
// If waterlevel is below 94%, Freshwater ATO on until 99% or greater
if (ReefAngel.WaterLevel.GetLevel()<=94) ReefAngel.Relay.On(Port5);
if (ReefAngel.WaterLevel.GetLevel()>=99) ReefAngel.Relay.Off(Port5);
Now, I noticed that sometimes the reading is lower than it supposed to be (leak somewhere).
I would use my float switch (high ato ) as a failsafe, however I would like to keep the wires on the top (out of the water).
Is there a line of code that when the high auto is deactivated (float touching the wire end) as a result of Freshwater pump kept running, port 5 will be switched off. And where do I put the code? Before or after the code, mentioned above? I don't want it to be in conflict with the above code.
Hope you guys can help me out.
Leslie
Float switch as a fail safe for the waterlevel expansion
-
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Float switch as a fail safe for the waterlevel expansion
if (!ReefAngel.HighATO.IsActive) ReefAngel.Relay.Off(Port5);
I would also consider replacing the code you have with the WaterLevelATO function. This will give you the benefit of a timeout as well.
ReefAngel.WaterLevelATO(Port5,30,94,99);
I would also consider replacing the code you have with the WaterLevelATO function. This will give you the benefit of a timeout as well.
ReefAngel.WaterLevelATO(Port5,30,94,99);
Re: Float switch as a fail safe for the waterlevel expansion
Make sure the float switch check comes after anything that would turn it on.
-
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Float switch as a fail safe for the waterlevel expansion
Thank you Lee.
When I put the code at the end, I get the following error:
sketch_Jan15_2015_A.cpp: In function 'void loop()':
sketch_Jan15_2015_A:234: error: could not convert 'ReefAngel.ReefAngelClass::HighATO.RA_ATOHighClass::IsActive' to 'bool'
sketch_Jan15_2015_A:234: error: in argument to unary !
Any suggestions?
Thanks in advance.
Leslie
When I put the code at the end, I get the following error:
sketch_Jan15_2015_A.cpp: In function 'void loop()':
sketch_Jan15_2015_A:234: error: could not convert 'ReefAngel.ReefAngelClass::HighATO.RA_ATOHighClass::IsActive' to 'bool'
sketch_Jan15_2015_A:234: error: in argument to unary !
Any suggestions?
Thanks in advance.
Leslie
Re: Float switch as a fail safe for the waterlevel expansion
Sorry forgot the () after IsActive
-
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Float switch as a fail safe for the waterlevel expansion
Thank you Lee,
So the only difference is the exclamation mark in front of ReefAngel to do the reverse thing?
So the only difference is the exclamation mark in front of ReefAngel to do the reverse thing?
Re: Float switch as a fail safe for the waterlevel expansion
Yeah that means if we're not active. You may have to remove that if the behavior isnt what you'd expect