commit 4611d82775866fa60c40d19c30730b064f9c9b33 Author: marcsello Date: Mon Jul 19 17:10:03 2021 +0200 Added led test script diff --git a/ledtest.py b/ledtest.py new file mode 100644 index 0000000..51d55ec --- /dev/null +++ b/ledtest.py @@ -0,0 +1,33 @@ +import RPi.GPIO as GPIO +import time + +GPIO.setmode(GPIO.BCM) + +GPIO.setup(23, GPIO.OUT, initial=GPIO.LOW) +GPIO.setup(24, GPIO.OUT, initial=GPIO.LOW) +GPIO.setup(26, GPIO.OUT, initial=GPIO.LOW) + + +def do_blinky(): + while True: + GPIO.output(23, False) + GPIO.output(24, False) + GPIO.output(26, True) + time.sleep(0.5) + GPIO.output(23, False) + GPIO.output(24, True) + GPIO.output(26, False) + time.sleep(0.5) + GPIO.output(23, True) + GPIO.output(24, False) + GPIO.output(26, False) + time.sleep(0.5) + + +try: + do_blinky() +except KeyboardInterrupt: + pass + + +GPIO.cleanup()