int buttonState ;
int buzzer = 2;
int pir = 14;
void setup() {
pinMode(pir, INPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop() {
int buttonState = digitalRead(pir);
Serial.println("buttonState : "); Serial.println("buttonState");
if (buttonState == 1) {
Serial.println("buzzer : on");
digitalWrite(buzzer,LOW);
} else if (buttonState == 0){
Serial.println("buzzer : off");
digitalWrite(buzzer,HIGH);
}
delay(1000);
}