From 08675bdc5cbaeeb068998b9d0d00fa889ced6d2d Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Fri, 12 Feb 2021 17:43:10 +0100 Subject: [PATCH] Fix IR initial state --- compLib/IRSensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compLib/IRSensor.py b/compLib/IRSensor.py index b6fe55d..dfd8e6b 100644 --- a/compLib/IRSensor.py +++ b/compLib/IRSensor.py @@ -24,9 +24,9 @@ GPIO.set_mode(BOTTOM_MIDDLE_PIN, pigpio.INPUT) GPIO.set_mode(BOTTOM_RIGHT_PIN, pigpio.INPUT) states = { - str(BOTTOM_LEFT_PIN): 0, - str(BOTTOM_MIDDLE_PIN): 0, - str(BOTTOM_RIGHT_PIN): 0} + str(BOTTOM_LEFT_PIN): GPIO.read(BOTTOM_LEFT_PIN), + str(BOTTOM_MIDDLE_PIN): GPIO.read(BOTTOM_MIDDLE_PIN), + str(BOTTOM_RIGHT_PIN): GPIO.read(BOTTOM_RIGHT_PIN)} def gpio_callback(gpio, level, tick): states[str(gpio)] = level