In filament_motion_sensor_connection_check.py
Not sure of the practical implications, but the line GPIO.remove_event_detect(USED_PIN) seems that will never be executed.
def main():
try:
GPIO.add_event_detect(USED_PIN, GPIO.BOTH, callback=motion)
while True:
timespan = (time.time() - lastMotion)
if timespan > max_not_moving_time:
print("No motion detected")
else:
print("Moving")
time.sleep(0.250)
GPIO.remove_event_detect(USED_PIN)
except KeyboardInterrupt:
print("Done")
pass
In filament_motion_sensor_connection_check.py
Not sure of the practical implications, but the line
GPIO.remove_event_detect(USED_PIN)seems that will never be executed.