led-on.py
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) GPIO.output(17,GPIO.HIGH)
led-off.py
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) GPIO.output(17,GPIO.LOW)
led-blink.py
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) while True: GPIO.output(17,GPIO.HIGH) time.sleep(1) GPIO.output(17,GPIO.LOW) time.sleep(1)
led-blink-3.py
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) GPIO.setup(27,GPIO.OUT) GPIO.setup(22,GPIO.OUT) while True: GPIO.output(17,GPIO.HIGH) time.sleep(.2) GPIO.output(17,GPIO.LOW) GPIO.output(27,GPIO.HIGH) time.sleep(.2) GPIO.output(27,GPIO.LOW) GPIO.output(22,GPIO.HIGH) time.sleep(.2) GPIO.output(22,GPIO.LOW)
led-off-3.py
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) GPIO.setup(27,GPIO.OUT) GPIO.setup(22,GPIO.OUT) GPIO.output(17,GPIO.LOW) GPIO.output(27,GPIO.LOW) GPIO.output(22,GPIO.LOW)