Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression is unreachable #30

Open
joaquinabian opened this issue Mar 4, 2023 · 0 comments
Open

Expression is unreachable #30

joaquinabian opened this issue Mar 4, 2023 · 0 comments

Comments

@joaquinabian
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant