If you're going to post python code on here you need to wrap it in [code][/code] tags. I've fixed your example for you.Code:
from gpiozero import MotionSensorfrom signal import pausemotion_sensor = MotionSensor(4)def motion(): print("Motion detected")def no_motion(): print("Motion stopped")print("Readying sensor...")motion_sensor.wait_for_no_motion()print("Sensor ready")motion_sensor.when_motion = motionmotion_sensor.when_no_motion = no_motionpause()
Statistics: Posted by DougieLawson — Sun Jul 21, 2024 10:39 am