From acc0f965ff4df40ed3918f209c2d66fe709c14cf Mon Sep 17 00:00:00 2001 From: Raspithek Date: Tue, 25 Apr 2023 13:27:20 +0200 Subject: [PATCH] Arbeitsversion von Teil 14. --- Readme.md | 4 +++- teil14/.gitignore | 2 ++ teil14/led.py | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 teil14/.gitignore create mode 100755 teil14/led.py diff --git a/Readme.md b/Readme.md index 745fb6d..5a254da 100644 --- a/Readme.md +++ b/Readme.md @@ -17,5 +17,7 @@ CC-BY-SA Olli Graf |10 | Dateien| |11 | Datum und Zeit| |12 | Multithreading| -|12 | Netzwerk| +|13 | Netzwerk| +|14 | GPIO| +|15 | Testing| diff --git a/teil14/.gitignore b/teil14/.gitignore new file mode 100644 index 0000000..c7fb3aa --- /dev/null +++ b/teil14/.gitignore @@ -0,0 +1,2 @@ +./__pycache__ +./network/__pycache__/* diff --git a/teil14/led.py b/teil14/led.py new file mode 100755 index 0000000..5574a2c --- /dev/null +++ b/teil14/led.py @@ -0,0 +1,23 @@ +#! /usr/bin/python3 + +import RPi.GPIO as GPIO +from time import sleep + +__PIN__ = 18 + +GPIO.setwarnings(False) +GPIO.setmode(GPIO.BCM) +GPIO.setup(__PIN__,GPIO.OUT) + +while True: + + GPIO.output(__PIN__,GPIO.HIGH) + print('LED ein') + + sleep(0.5) + + GPIO.output(__PIN__,GPIO.LOW) + print('LED aus') + + +