filter flares on sensor pin
This commit is contained in:
@@ -74,6 +74,12 @@ try:
|
|||||||
logging.info('Wait for photo sensor')
|
logging.info('Wait for photo sensor')
|
||||||
GPIO.wait_for_edge(PIN_SENSOR, GPIO.RISING)
|
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')
|
logging.info('Photo sensor active, activating light and camera')
|
||||||
play(SOUND_SCANNING)
|
play(SOUND_SCANNING)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user