const int buzzerPin = 6;
void setup() {
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(buzzerPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 1000);
delay(100);
noTone(buzzerPin);
delay(100); // wait for a second
digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(11, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 8000);
delay(100);
noTone(buzzerPin);
delay(100); // wait for a second
digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 6000);
delay(100);
noTone(buzzerPin);
delay(100); // wait for a second
digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(9, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 4000);
delay(100);
noTone(buzzerPin);
delay(100); // wait for a second
digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(8, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 3000);
delay(100);
noTone(buzzerPin);
delay(100); // wait for a second
digitalWrite(7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
delay(100);
tone(buzzerPin, 2000);
delay(100);
noTone(buzzerPin);
delay(100);
}