Help with Buzzer code

Basic / Standard Reef Angel hardware
Post Reply
Smotz
Posts: 412
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Help with Buzzer code

Post 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);
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Help with Buzzer code

Post by lnevo »

Cause you're checking for temperature above 8.5 degreess :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Help with Buzzer code

Post by lnevo »

DigitalWrite I think. The Ato ports are pwm
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Help with Buzzer code

Post by lnevo »

And I think the WL ATO bug is triggering the timeout not this
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Help with Buzzer code

Post 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
Smotz
Posts: 412
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: Help with Buzzer code

Post 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.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Help with Buzzer code

Post by lnevo »

Yeah didnt help that I added a fix for StandardHeater that let you use two digits :)
Post Reply