Update garage.py
This commit is contained in:
@@ -31,7 +31,7 @@ def motor_button(channel):
|
|||||||
logging.info("trigger motor")
|
logging.info("trigger motor")
|
||||||
GPIO.output(PIN_MOTOR, GPIO.LOW)
|
GPIO.output(PIN_MOTOR, GPIO.LOW)
|
||||||
GPIO.output(PIN_LED, GPIO.HIGH)
|
GPIO.output(PIN_LED, GPIO.HIGH)
|
||||||
time.sleep(0.8)
|
time.sleep(0.4)
|
||||||
GPIO.output(PIN_MOTOR, GPIO.HIGH)
|
GPIO.output(PIN_MOTOR, GPIO.HIGH)
|
||||||
GPIO.output(PIN_LED, GPIO.LOW)
|
GPIO.output(PIN_LED, GPIO.LOW)
|
||||||
|
|
||||||
@@ -39,12 +39,12 @@ def remote_button(channel):
|
|||||||
logging.info("trigger remote")
|
logging.info("trigger remote")
|
||||||
GPIO.output(PIN_REMOTE, GPIO.HIGH)
|
GPIO.output(PIN_REMOTE, GPIO.HIGH)
|
||||||
GPIO.output(PIN_LED, 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_REMOTE, GPIO.LOW)
|
||||||
GPIO.output(PIN_LED, 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_MOTOR_BUTTON, GPIO.RISING, callback=motor_button, bouncetime=250)
|
||||||
GPIO.add_event_detect(PIN_REMOTE_BUTTON, GPIO.FALLING, callback=remote_button, bouncetime=200)
|
GPIO.add_event_detect(PIN_REMOTE_BUTTON, GPIO.RISING, callback=remote_button, bouncetime=250)
|
||||||
|
|
||||||
GPIO.output(PIN_MOTOR, GPIO.HIGH)
|
GPIO.output(PIN_MOTOR, GPIO.HIGH)
|
||||||
GPIO.output(PIN_REMOTE, GPIO.LOW)
|
GPIO.output(PIN_REMOTE, GPIO.LOW)
|
||||||
@@ -77,4 +77,4 @@ class GarageService(object):
|
|||||||
cherrypy.quickstart(GarageService())
|
cherrypy.quickstart(GarageService())
|
||||||
logging.info('Shutdown')
|
logging.info('Shutdown')
|
||||||
logging.info('Reset GPIO configuration and close')
|
logging.info('Reset GPIO configuration and close')
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
Reference in New Issue
Block a user