next test with GPIO relay controller
Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>master
parent
255481d7cf
commit
667eb93b76
3
main.py
3
main.py
|
@ -25,8 +25,9 @@ def error_print(message: str):
|
||||||
|
|
||||||
#relay
|
#relay
|
||||||
def relay_controller(pin: int, state: str):
|
def relay_controller(pin: int, state: str):
|
||||||
|
GPIO.cleanup()
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(pin, GPIO.OUT)
|
GPIO.setup(pin, GPIO.OUT)
|
||||||
if state == "True":
|
if state == "True":
|
||||||
# relay = gpiozero.OutputDevice(pin, active_high=False, initial_value=False)
|
# relay = gpiozero.OutputDevice(pin, active_high=False, initial_value=False)
|
||||||
# relay.on()
|
# relay.on()
|
||||||
|
|
Loading…
Reference in New Issue