Page 1 of 1

piezo pin 16

Posted: Thu Nov 03, 2011 12:40 pm
by jsclownfish
I noticed in looking through the pre-packaged code that their was a piezo defined on pin 16. This may seem like a stupid question, but where does pin16 lead to? I ordered a buzzer and I wanted to try it out.

Thanks,
Jon

Re: piezo pin 16

Posted: Thu Nov 03, 2011 12:49 pm
by rimai
Very old leftover definition.
It is not used anymore and should be removed.
The buzzer can be connected to any ATO Port or PWM Output port.
You can use one of the following to turn the buzzer on, depending on which port you choose:

Code: Select all

ReefAngel.PWM.SetActinic(100);

Code: Select all

ReefAngel.PWM.SetDaylight(100);

Code: Select all

pinMode(highATOPin,OUTPUT);
digitalWrite(highATOPin,HIGH);

Code: Select all

pinMode(lowATOPin,OUTPUT);
digitalWrite(lowATOPin,HIGH);

Re: piezo pin 16

Posted: Fri Nov 04, 2011 6:25 pm
by jsclownfish
OK, thanks. So if I want to trigger the alarm at 83F what is the name of the first temp probe, or do I need to define it. Sorry, I'm a really confused with the impact of the libraries and what they cover in the code. I'm guessing it would look something like this...

if (T1>830)
{
ReefAngel.PWM.SetDaylight(100);
}


Thanks again,
Jon

Re: piezo pin 16

Posted: Fri Nov 04, 2011 6:31 pm
by rimai
Try this:

Code: Select all

  if (ReefAngel.Params.Temp1>830) ReefAngel.PWM.SetDaylight(100); else ReefAngel.PWM.SetDaylight(0);