const int buzzerPin = 9; // Buzzer pin raqami
const int ledPins[] = {2, 3, 4, 5, 6, 7, 8}; // 7 ta LED pin raqamlari
void setup() {
pinMode(buzzerPin, OUTPUT); // Buzzer ni chiqarish uchun pin raqamini chiqish sifatida sozlash
for (int i = 0; i < 7; i++) {
pinMode(ledPins[i], OUTPUT); // Har bir LED ni chiqarish uchun pin raqamini chiqish sifatida sozlash
}
}
void loop() {
// Buzzerda 0.5 sekund oralig'ida 7 ta nota ijro etish
for (int i = 0; i < 7; i++) {
tone(buzzerPin, 1000 + i * 100, 500); // Buzzerda nota ijro etish
delay(500); // 0.5 sekund kutish
digitalWrite(ledPins[i], HIGH); // Mos LEDni yoqish
delay(500); // 0.5 sekund kutish
digitalWrite(ledPins[i], LOW); // LEDni o'chirish
}
// Barcha LEDlarni o'chirish
for (int i = 0; i < 7; i++) {
digitalWrite(ledPins[i], LOW);
}
noTone(buzzerPin); // Buzzerda tovushni to'xtatish
}