I have setup my raspberry pi and have inserted the correct wires to the motion sensor, i am currently running a a simple script that detects motion however it constantly outputs that it motion is detected although i have no interacted with the sensor. I am unsure as to what i should do as ive tried numerous things.
here is the script also:
from gpiozero import MotionSensor
import time
print ("Ready")
pir = MotionSensor(4)
time.sleep(40)
while True:
if pir.motion_detected:
print("Motion detected")
time.sleep(2)