Page 1 of 1

Multi Channel water level sensor

Posted: Mon Feb 03, 2014 7:27 pm
by Drew471
I am trying to use channel one on the multilevel water sensor for my auto top off.

The problem is using the Wizard it defaults to channel 0, how do I change this to go to channel one? go inside the library?

Thanks!
Drew

Re: Multi Channel water level sensor

Posted: Mon Feb 03, 2014 7:47 pm
by rimai
The libraries only support the single channel at the moment.
I created a bug report to add support to the new channels.
https://github.com/reefangel/Libraries/issues/138

Re: Multi Channel water level sensor

Posted: Sun Feb 16, 2014 8:42 pm
by Drew471
So if I wanted to program it without the wizard how would I program that to turn a port on or off based about the level of the water of sensor 1(on at X% off at Y%).


Thanks!

Re: Multi Channel water level sensor

Posted: Sun Feb 16, 2014 9:01 pm
by rimai
Try this:

Code: Select all

if (ReefAngel.WaterLevel.GetLevel(1)<=20) ReefAngel.Relay.On(Port1);
if (ReefAngel.WaterLevel.GetLevel(1)>=30) ReefAngel.Relay.Off(Port1);

Re: Multi Channel water level sensor

Posted: Tue Feb 18, 2014 2:32 pm
by Sacohen
Gotta remember this for when I get my multi level unit in about a month.

Re: Multi Channel water level sensor

Posted: Thu Feb 20, 2014 5:56 pm
by Drew471
Okay so what if I wanted a time out on that? Also can I do conditional such as If Sensor 1 is above X AND Sensor 2 is above Y then turn the pump on?

I am planning on having one in my water top off tank so I would like it to text/email me when below X and then Text/email me AND not allow the port to turn on when below Y%.

Does that make sense? Thanks! I am still learning how this programming thing works

Also I am planning on

Re: Multi Channel water level sensor

Posted: Thu Feb 20, 2014 10:55 pm
by rimai
The timeout is not implemented yet.
It is in the list of issues: https://github.com/reefangel/Libraries/issues/138
For and comparisons you can use this:

Code: Select all

if (ReefAngel.WaterLevel.GetLevel(1)>=20 && ReefAngel.WaterLevel.GetLevel(2)>=30)
 ReefAngel.Relay.On(Port1);
else
 ReefAngel.Relay.Off(Port1);
According to this code, there pump would not turn on if 1 is below 20 or 2 is below 30.
Both the conditions need to be true in order for the pump to turn on.
That's what the && sign is for. It reads AND.
Here is some more info:
http://arduino.cc/en/Reference/Boolean