a very simple tutorial that blinks a led and makes a piezo beep
join led with a 220 ohm resistor to pin 13 and piezo with a resistor of your choice to pin 3
int piezoPin = 3;
int ledPin = 13;
void loop()
{
digitalWrite(piezoPin, HIGH);
digitalWrite(ledPin, HIGH);
delay (1000)
digitalWrite(piezoPin, LOW);
digitalWrite(ledPin, LOW);
delay (1000)
}
please let me know if this is better than the blink example