From 2dd174d73bc411ce9157d970e4f84d3b9512aeda Mon Sep 17 00:00:00 2001 From: Tilman Date: Thu, 6 Aug 2020 12:26:03 +0000 Subject: [PATCH] Update garage.py --- garage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/garage.py b/garage.py index 1b5d2ff..34d1afd 100644 --- a/garage.py +++ b/garage.py @@ -31,7 +31,7 @@ def motor_button(channel): logging.info("trigger motor") GPIO.output(PIN_MOTOR, GPIO.LOW) GPIO.output(PIN_LED, GPIO.HIGH) - time.sleep(0.8) + time.sleep(0.4) GPIO.output(PIN_MOTOR, GPIO.HIGH) GPIO.output(PIN_LED, GPIO.LOW) @@ -39,12 +39,12 @@ def remote_button(channel): logging.info("trigger remote") GPIO.output(PIN_REMOTE, GPIO.HIGH) GPIO.output(PIN_LED, GPIO.HIGH) - time.sleep(0.8) + time.sleep(0.4) GPIO.output(PIN_REMOTE, GPIO.LOW) GPIO.output(PIN_LED, GPIO.LOW) -GPIO.add_event_detect(PIN_MOTOR_BUTTON, GPIO.FALLING, callback=motor_button, bouncetime=200) -GPIO.add_event_detect(PIN_REMOTE_BUTTON, GPIO.FALLING, callback=remote_button, bouncetime=200) +GPIO.add_event_detect(PIN_MOTOR_BUTTON, GPIO.RISING, callback=motor_button, bouncetime=250) +GPIO.add_event_detect(PIN_REMOTE_BUTTON, GPIO.RISING, callback=remote_button, bouncetime=250) GPIO.output(PIN_MOTOR, GPIO.HIGH) GPIO.output(PIN_REMOTE, GPIO.LOW) @@ -77,4 +77,4 @@ class GarageService(object): cherrypy.quickstart(GarageService()) logging.info('Shutdown') logging.info('Reset GPIO configuration and close') -GPIO.cleanup() +GPIO.cleanup() \ No newline at end of file