From 43bd91c238e3ae86cac430f2cef71d93eb6d1641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 6 Jul 2022 19:18:23 +0200 Subject: [PATCH] changed some code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- requirements.txt | 2 +- test.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8b13789..65f7416 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ - +gpiozero==1.6.2 diff --git a/test.py b/test.py index f6c00c1..e517c30 100644 --- a/test.py +++ b/test.py @@ -1,15 +1,10 @@ import time import os -import RPi.GPIO as GPIO - - -GPIO.setmode(GPIO.BOARD) -GPIO.setwarnings(False) +from gpiozero import * pins = [8,10,12,16,18,22,24,26] for pin in pins: print(pin) - GPIO.setup(pin, GPIO.OUT) - GPIO.output(pin, GPIO.LOW) -GPIO.cleanup() \ No newline at end of file + relay = gpiozero.OutputDevice(pin, active_high=False, initial_value=False) + relay.on() \ No newline at end of file