Salvatore "Sal" Testa /@saltesta14
int SPEAKER = P2_0;
void setup()
{
pinMode(SPEAKER, OUTPUT);
}
int waittime = 2;
void loop()
{
digitalWrite(SPEAKER,HIGH);
delay(waittime);
digitalWrite(SPEAKER,LOW);
delay(waittime);
} // Oh jeez, make it stop
int SPEAKER = P2_0;
int highDelay = 2;
int lowDelay = 3;
void setup()
{
pinMode(SPEAKER, OUTPUT);
}
void loop()
{
digitalWrite(SPEAKER,HIGH);
delay(highDelay);
digitalWrite(SPEAKER,LOW);
delay(lowDelay);
} // Sounds like the Brown fire alarm
int SPEAKER = P2_0;
int BUTTON = P1_3;
int highDelay = 2;
int lowDelay = 3;
void setup()
{
pinMode(SPEAKER, OUTPUT);
pinMode(BUTTON, INPUT_PULLUP);
}
void loop()
{
if(digitalRead(BUTTON) == LOW) { // keep your friends
digitalWrite(SPEAKER,HIGH);
delay(highDelay);
digitalWrite(SPEAKER,LOW);
delay(lowDelay);
}
}
Modify toneMelody (from the examples)