Just add an exclamation mark
Code: Select all
digitalWrite(highATOPin,!ReefAngel.IO.GetChannel(0));
Code: Select all
digitalWrite(highATOPin,!ReefAngel.IO.GetChannel(0));
So then...how would I change this line of code:rimai wrote:You can get a little bit louder if you use one of the PWM ports.
ATO ports = 5V
PWM ports = 10V
But if you need something much louder, you will need to use on of the relay ports and a stand alone buzzer.
Code: Select all
//turn off port 8 - main pump when switch is tripped and sound buzzer
ReefAngel.Relay.Set(Port8,ReefAngel.IO.GetChannel(0));
pinMode(highATOPin,OUTPUT);
digitalWrite(highATOPin,!ReefAngel.IO.GetChannel(0));
Code: Select all
//turn off port 8 - main pump when switch is tripped and sound buzzer
ReefAngel.Relay.Set(Port8,ReefAngel.IO.GetChannel(0));
ReefAngel.PWM.SetDaylight(ReefAngel.IO.GetChannel(0)*100);
This ALMOST works. I put in the line of code and now the buzzer screams when the switch is NOT TRIPPED rather than when it is. I tested by tripping the switch and it turned off. I probably need a !, but not sure where to put it. Thxrimai wrote:Replace the above with this:Code: Select all
//turn off port 8 - main pump when switch is tripped and sound buzzer ReefAngel.Relay.Set(Port8,ReefAngel.IO.GetChannel(0)); ReefAngel.PWM.SetDaylight(ReefAngel.IO.GetChannel(0)*100);
Code: Select all
//turn off port 8 - main pump when switch is tripped and sound buzzer
ReefAngel.Relay.Set(Port8,ReefAngel.IO.GetChannel(0));
ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(0)*100));
This works as designed. Thanks. As I was testing, I got to thinking, however. I read a blurb on here recently where once the overflow trips, you want it to stay tripped until you can get to the tank and clear the blockage or whatever was causing the overflow switch to stop the pump. This would prevent the tank from draining, resetting the float switch, restarting the pump until it backed up and tripped the switch again. Is this possible?rimai wrote:Try this:Code: Select all
//turn off port 8 - main pump when switch is tripped and sound buzzer ReefAngel.Relay.Set(Port8,ReefAngel.IO.GetChannel(0)); ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(0)*100));
How long does it take the portal to pick up these alerts and send out the emails? Again I was testing tonite, held the switch tripped for 40-50 seconds, at least, but still didn't send. LMK and Thanks as always.Oh, in this case it is simple.
You can use one of the custom variables.
CODE: SELECT ALL
ReefAngel.CustomVar[0]=ReefAngel.IO.GetChannel(0);
ReefAngel.CustomVar[7]=1;
Then, on the Portal, you can set a trigger to send you alerts when C0 = 0.
sounds like exactly what I want. Keep in mind we have a setting on the portal to send a email\text message when CustomField0 changes from 1 to 0. Don't want this new code to override that. ThxWe can also leave the pump the way it is and make the custom variable stick, so if it does trip, the custom variable will change and not go back until you inspect.
Code: Select all
ReefAngel.CustomVar[0]=ReefAngel.IO.GetChannel(0);
Code: Select all
if (ReefAngel.IO.GetChannel(0)) ReefAngel.CustomVar[0]=1;