diff --git a/code/piplayer4.py b/code/piplayer4.py index 2e48f2d..cf39d00 100644 --- a/code/piplayer4.py +++ b/code/piplayer4.py @@ -92,7 +92,7 @@ try: while True: 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') play(SOUND_SCANNING) @@ -137,8 +137,8 @@ try: GPIO.output(PIN_LED, GPIO.LOW) # wait until sensor is not blocked anymore - if (GPIO.input(PIN_SENSOR) == GPIO.HIGH): - GPIO.wait_for_edge(PIN_SENSOR, GPIO.FALLING) + if (GPIO.input(PIN_SENSOR) == GPIO.LOW): + GPIO.wait_for_edge(PIN_SENSOR, GPIO.RISING) time.sleep(1)