Added led test script

This commit is contained in:
Pünkösd Marcell 2021-07-19 17:10:03 +02:00
commit 4611d82775

33
ledtest.py Normal file
View File

@ -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()