int buzzer = 2;
int tombol = 4;
void setup() {
// put your setup code here, to run once:
pinMode(buzzer, OUTPUT);
pinMode(tombol, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(tombol) == LOW){
digitalWrite(buzzer, LOW);
delay(1000);
}
else{
digitalWrite(buzzer, HIGH);
delay(1000);
}
}