Page 1 of 1

Help with Buzzer code

Posted: Sat Jul 16, 2016 6:53 am
by Smotz
'Lo all. I put this buzzer code in buzz the buzzer rings constantly. Can anyone advise where I went wrong?
And also, how do I get this to NOT trigger my ATO Timeout?

Should I be using analogWrite or digitalWrite? I have an analog RA (not PWM).

Code: Select all

// Buzzer if temp is too high or low, or waterlevel 1 is too high or too low.
if ( ReefAngel.Params.Temp[T1_PROBE] < 700 || ReefAngel.Params.Temp[T1_PROBE] > 85 || ReefAngel.WaterLevel.GetLevel(1) > 135 || ReefAngel.WaterLevel.GetLevel(1) < 70)
{
pinMode(lowATOPin,OUTPUT);
digitalWrite(lowATOPin,HIGH);
}
else
{
pinMode(lowATOPin,OUTPUT);
digitalWrite(lowATOPin,LOW);
}

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 9:52 am
by lnevo
Cause you're checking for temperature above 8.5 degreess :)

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 9:52 am
by lnevo
DigitalWrite I think. The Ato ports are pwm

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 9:53 am
by lnevo
And I think the WL ATO bug is triggering the timeout not this

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 9:54 am
by lnevo
One lat thing. I believe the WL tops out somewhere maybe 120. Have you tested to see if it goes that high? Maybe we set it to 200. I dont remember

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 10:36 am
by Smotz
lnevo wrote:Cause you're checking for temperature above 8.5 degreess :)
I accidentally reported this post :lol:

Oh my god..the little things. Always look at syntax..

This represented about 2 hours of my life. Thank you.

Re: Help with Buzzer code

Posted: Sat Jul 16, 2016 1:25 pm
by lnevo
Yeah didnt help that I added a fix for StandardHeater that let you use two digits :)