Skip to content

Expression is unreachable #30

Description

@joaquinabian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions