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