- Raspberry Pi
- BreadBoard or T-Cobbler
- Jumper Wires
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Connect Your Raspberry Pi GPIO With LED on Breadboard or Multi-function Board
Now as per video you can use pin number 27 as output and connect GND with led's GND terminal,
Make sure your GPIO connection should be correct.
Step 2: Setup
Connect LED on breadbard or T-cobbler as attached video.
Step 3: Install GPIO Libraries
$ sudo apt-get update
$ sudo apt-get install python-rpi.gpio python3-rpi.gpio
Step 4: Program
import RPi.GPIO as GPIO
LedPin = 11 # pin11
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.output(LedPin, GPIO.HIGH) # Set LedPin high(+3.3V) to turn on led
GPIO.output(LedPin, GPIO.HIGH) # led on
GPIO.output(LedPin, GPIO.LOW) # led off time.sleep(1)
GPIO.output(LedPin, GPIO.LOW) # led off
GPIO.cleanup() # Release resource
if __name__ == '__main__':