I'm sure this has been answered, but I can't figure out how to make a good IO Expansion code.
What I have is two hard switches that I would like to do a few things.
Switch one: lights on mode,
Switch two: water-change mode, but resets after about 5 minutes (in case the switch is left in the on position)
I also would like one of the IO ports to send me n email if activated (high water level in filter sock section)
I think after I get those codes, I should be able to deduce how to write new code for it. Just not sure on how to begin.
Thanks in advance for the help!
IO Expansion
Re: IO Expansion
Use momentary switches.
That way you never take the risk of leaving it on.
That way you never take the risk of leaving it on.
Code: Select all
if (ReefAngel.IO.GetChannel(0)) ReefAngel.LightsOn();
if (ReefAngel.IO.GetChannel(1)) ReefAngel.WaterChangeModeStart();
Roberto.
Re: IO Expansion
Thanks!rimai wrote:Use momentary switches.
That way you never take the risk of leaving it on.Code: Select all
if (ReefAngel.IO.GetChannel(0)) ReefAngel.LightsOn(); if (ReefAngel.IO.GetChannel(1)) ReefAngel.WaterChangeModeStart();
Good point on the momentary switches. That's what I have on the HighAto port to get it into water change mode.
If it's a momentary switch, will the RA count down before it resets to normal mode?