Light Emitting Diodes

Basic tutorial of how to interact with multiple LEDs on the raspberry pi.

PARTS:
RPI 3 – https://amzn.to/2VA9pQY
4 Amp Power Adapter – https://amzn.to/2CTptWu
16GB micro SD – https://amzn.to/2SFMwd3
120 pcs jumper cable: https://ebay.to/2VAb9cY
LEDs and resistors kit: https://amzn.to/2RcI9Jv
Breadboards: https://ebay.to/2RaA6Nv

SCHEMATIC:

CODE:

import time
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

led1 = 17
led2 = 27

GPIO.setup(led1,GPIO.OUT)
GPIO.setup(led2,GPIO.OUT)

print("Lights on")
GPIO.output(led1,GPIO.HIGH)
GPIO.output(led2,GPIO.HIGH)

time.sleep(5)

print("Light off")
GPIO.output(led1,GPIO.LOW)
GPIO.output(led2,GPIO.LOW)

GPIO.cleanup()