#define LED_pink 2
#define buzzer 3
void setup() {
pinMode(LED_pink, OUTPUT);
pinMode(buzzer, OUTPUT);
}
// class lampu berkedip
void lampu_kedip() {
digitalWrite(LED_pink, HIGH);
tone(buzzer, 300);
delay(100);
digitalWrite(LED_pink, LOW);
noTone(buzzer);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly;
int count = 0; // Initialize a counter
while (count < 5) {
lampu_kedip(); // Call the function to blink the LED
delay(1000); // Delay between each blink
count++; // Increase the counter
}
}