Update piplayer4.py

This commit is contained in:
2018-12-12 21:39:08 +00:00
parent 7b89db9759
commit fea202b0d4
+3 -3
View File
@@ -92,7 +92,7 @@ try:
while True: while True:
logging.info('Wait for photo sensor') logging.info('Wait for photo sensor')
GPIO.wait_for_edge(PIN_SENSOR, GPIO.FALLING) ## TODO TEST GPIO.wait_for_edge(PIN_SENSOR, GPIO.FALLING)
logging.info('Photo sensor active, activating light and camera') logging.info('Photo sensor active, activating light and camera')
play(SOUND_SCANNING) play(SOUND_SCANNING)
@@ -137,8 +137,8 @@ try:
GPIO.output(PIN_LED, GPIO.LOW) GPIO.output(PIN_LED, GPIO.LOW)
# wait until sensor is not blocked anymore # wait until sensor is not blocked anymore
if (GPIO.input(PIN_SENSOR) == GPIO.HIGH): if (GPIO.input(PIN_SENSOR) == GPIO.LOW):
GPIO.wait_for_edge(PIN_SENSOR, GPIO.FALLING) GPIO.wait_for_edge(PIN_SENSOR, GPIO.RISING)
time.sleep(1) time.sleep(1)