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