From 68ddbc881a935d789ed241bd9ddbcce7f0cf95d9 Mon Sep 17 00:00:00 2001 From: Sandro Zimmermann Date: Sat, 6 Dec 2025 10:23:14 +0100 Subject: [PATCH] led.py turn on/off led --- py/led.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 py/led.py diff --git a/py/led.py b/py/led.py new file mode 100644 index 0000000..16fc1e8 --- /dev/null +++ b/py/led.py @@ -0,0 +1,16 @@ +import RPi.GPIO as GPIO +import time + +LED_PIN = 17 + +GPIO.setmode(GPIO.BCM) +GPIO.setup(LED_PIN, GPIO.OUT) + +try: + while True: + GPIO.output(LED_PIN, GPIO.HIGH) + time.sleep(1) + GPIO.output(LED_PIN, GPIO.LOW) + time.sleep(1) +except KeyboardInterrupt: + GPIO.cleanup() \ No newline at end of file