int pir = 12;
int buzzpin = 11;
void setup() {
// put your setup code here, to run once:
pinMode(pir, INPUT);
pinMode(buzzpin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int value_of_pir = digitalRead(pir);
if (value_of_pir==HIGH){
tone(buzzpin, 500, 3);
}
else
tone(buzzpin, 0, 1);
}