From 94e20b9cd9cc20dee53eb0b84f5554ad8ff14700 Mon Sep 17 00:00:00 2001 From: rav4s Date: Fri, 18 Dec 2020 10:10:06 -0600 Subject: [PATCH] Reduced sensor wait time --- garage_door_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garage_door_script.py b/garage_door_script.py index 27ac0a0..7ca2659 100644 --- a/garage_door_script.py +++ b/garage_door_script.py @@ -27,7 +27,7 @@ def index(): if logged_in == "yes": GPIO.setup(PIN_TRIG, GPIO.OUT) #Setup the gpio trigger pin as input GPIO.setup(PIN_ECHO, GPIO.IN) #Setup the gpio echo pin as output - time.sleep(2) #Wait for 2 seconds for sensor to settle + time.sleep(0.5) #Wait for 0.5 seconds for sensor to settle GPIO.output(PIN_TRIG, GPIO.LOW) #Set trigger to low GPIO.output(PIN_TRIG, GPIO.HIGH) #Set trigger to high time.sleep(0.00001) #Wait for 0.1 milliseconds before setting to low again