Raspberry Pi Blinking LED (Python Code)
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(14,GPIO.OUT)
GPIO.output(14, True)
time.sleep(1)
GPIO.output(14, False)
GPIO.setup(15,GPIO.OUT)
GPIO.output(15, True)
time.sleep(1)
GPIO.output(15, False)
GPIO.setup(18,GPIO.OUT)
GPIO.output(18, True)
time.sleep(1)
GPIO.output(18, False)
GPIO.setup(23,GPIO.OUT)
GPIO.output(23, True)
time.sleep(1)
GPIO.output(23, False)
GPIO.setup(24,GPIO.OUT)
GPIO.output(24, True)
time.sleep(1)
GPIO.output(24, False)
GPIO.setup(25,GPIO.OUT)
GPIO.output(25, True)
time.sleep(1)
GPIO.output(25, False)
GPIO.setup(8,GPIO.OUT)
GPIO.output(8, True)
time.sleep(1)
GPIO.output(8, False)
GPIO.setup(7,GPIO.OUT)
GPIO.output(7, True)
time.sleep(1)
GPIO.output(7, False)
GPIO.setup(12,GPIO.OUT)
GPIO.output(12, True)
time.sleep(1)
GPIO.output(12, False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(14,GPIO.OUT)
GPIO.output(14, True)
time.sleep(1)
GPIO.output(14, False)
GPIO.setup(15,GPIO.OUT)
GPIO.output(15, True)
time.sleep(1)
GPIO.output(15, False)
GPIO.setup(18,GPIO.OUT)
GPIO.output(18, True)
time.sleep(1)
GPIO.output(18, False)
GPIO.setup(23,GPIO.OUT)
GPIO.output(23, True)
time.sleep(1)
GPIO.output(23, False)
GPIO.setup(24,GPIO.OUT)
GPIO.output(24, True)
time.sleep(1)
GPIO.output(24, False)
GPIO.setup(25,GPIO.OUT)
GPIO.output(25, True)
time.sleep(1)
GPIO.output(25, False)
GPIO.setup(8,GPIO.OUT)
GPIO.output(8, True)
time.sleep(1)
GPIO.output(8, False)
GPIO.setup(7,GPIO.OUT)
GPIO.output(7, True)
time.sleep(1)
GPIO.output(7, False)
GPIO.setup(12,GPIO.OUT)
GPIO.output(12, True)
time.sleep(1)
GPIO.output(12, False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(14,GPIO.OUT)
GPIO.output(14, True)
time.sleep(1)
GPIO.output(14, False)
GPIO.setup(15,GPIO.OUT)
GPIO.output(15, True)
time.sleep(1)
GPIO.output(15, False)
GPIO.setup(18,GPIO.OUT)
GPIO.output(18, True)
time.sleep(1)
GPIO.output(18, False)
GPIO.setup(23,GPIO.OUT)
GPIO.output(23, True)
time.sleep(1)
GPIO.output(23, False)
GPIO.setup(24,GPIO.OUT)
GPIO.output(24, True)
time.sleep(1)
GPIO.output(24, False)
GPIO.setup(25,GPIO.OUT)
GPIO.output(25, True)
time.sleep(1)
GPIO.output(25, False)
GPIO.setup(8,GPIO.OUT)
GPIO.output(8, True)
time.sleep(1)
GPIO.output(8, False)
GPIO.setup(7,GPIO.OUT)
GPIO.output(7, True)
time.sleep(1)
GPIO.output(7, False)
GPIO.setup(12,GPIO.OUT)
GPIO.output(12, True)
time.sleep(1)
GPIO.output(12, False)
Comments
Post a Comment