piezo pin 16

Expansion modules and attachments
Post Reply
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

piezo pin 16

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: piezo pin 16

Post 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);
Roberto.
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: piezo pin 16

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: piezo pin 16

Post by rimai »

Try this:

Code: Select all

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