From 667eb93b76f0c64294ef7b9aed3c16d309f4c9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Thu, 14 Jul 2022 10:49:22 +0200 Subject: [PATCH] next test with GPIO relay controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7c81bbf..158e6ad 100644 --- a/main.py +++ b/main.py @@ -25,8 +25,9 @@ def error_print(message: str): #relay def relay_controller(pin: int, state: str): + GPIO.cleanup() GPIO.setmode(GPIO.BCM) - GPIO.setup(pin, GPIO.OUT) + GPIO.setup(pin, GPIO.OUT) if state == "True": # relay = gpiozero.OutputDevice(pin, active_high=False, initial_value=False) # relay.on()