int buzzPin = 7;
void setup() {
pinMode(buzzPin, OUTPUT);
}
void loop() {
playNote(440, 100);
delay(100);
playNote(440, 100);
delay(100);
playNote(440, 500);
delay(100);
}
void playNote(int frequency, int duration) {
tone(buzzPin, frequency, duration);
delay(duration);
noTone(buzzPin);
}