//Завдання 22. Приклад 4. Пишання при виявленні руху
/*#####PIR Motion Sensor Light Switch Arduino Project####
Connection:
Buzzer - Digital Pin 13
Motion Sensor - Digital Pin 02
And Connect the supply to above module*/
int buzzer = 13;
void setup()
{
pinMode(buzzer, OUTPUT); // Buzzer as output
digitalWrite(buzzer, LOW); //make Buzzer OFF
//PIR Motion Sensor connected at digital pin 2 i.e. interrupt 0
attachInterrupt(0, alarmON, RISING);
}
void loop()
{
}
void alarmON()
{
// Alarm ON
digitalWrite(buzzer, HIGH);
delay(100);
digitalWrite(buzzer, LOW);
delay(100);
}