diff --git a/code/audiorocket.py b/code/audiorocket.py index 701762f..b4ba325 100644 --- a/code/audiorocket.py +++ b/code/audiorocket.py @@ -74,6 +74,12 @@ try: logging.info('Wait for photo sensor') GPIO.wait_for_edge(PIN_SENSOR, GPIO.RISING) + # filter short spikes on the sensor cable + time.sleep(0.2) + if (GPIO.input(PIN_SENSOR) == GPIO.LOW): + logging.info('Flare, continue') + continue + logging.info('Photo sensor active, activating light and camera') play(SOUND_SCANNING)