I am using a RPi3 and with a PIR Sensor.
So I followed the codes in https://www.raspberrypi.org/learning/pa ... worksheet/
Code: Select all
from gpiozero import MotionSensor
pir = MotionSensor(4)
while True:
if pir.motion_detected:
print("Motion detected!")“Motion detected" is printed and it doesn't stop.
Why is that so?? Is my PIR having problem or the connection for RPi3 is different??