Added led test script
This commit is contained in:
commit
4611d82775
33
ledtest.py
Normal file
33
ledtest.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user