const int PIRpin=23;
const int BUZZERpin=22;
void setup(){
pinMode (PIRpin,INPUT);
pinMode (BUZZERpin,OUTPUT);
}
void loop() {
int motion = digitalRead(PIRpin);
if (motion == HIGH) {
digitalWrite(BUZZERpin,HIGH);
}
else {
digitalWrite(BUZZERpin,LOW);
}
}