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