Uploaded September 2012 | Updated September 2026, 1 week ago
Here is how to use your Raspberry Pi's GPIO pins... Part 2... Make sure to watch Part 1 first:
youtube.com/watch?v=H08BLCuhaxg
Commands used:
sudo apt-get install python-rpi.gpio
And if needed:
sudo apt-get install python-dev
Code is as follows:
import RPi.GPIO as gpio
import time
#set up pin 14 as an output
gpio.setmode(gpio.BCM)
gpio.setup(14, gpio.OUT)
#Make an LED flash on and off forever
while True:
gpio.output(14, gpio.HIGH)
time.sleep(1)
gpio.output(14, gpio.LOW)
time.sleep(1)
INDENTATION IS WRONG... Everything in the while loop MUST be 4 spaces in or 1 tab....
Happy Piing!
Please subscribe and tell you friends of my videos!
Here is how to use your Raspberry Pi's GPIO pins... Part 2... Make sure to watch Part 1 first:
youtube.com/watch?v=H08BLCuhaxg
Commands used:
sudo apt-get install python-rpi.gpio
And if needed:
sudo apt-get install python-dev
Code is as follows:
import RPi.GPIO as gpio
import time
#set up pin 14 as an output
gpio.setmode(gpio.BCM)
gpio.setup(14, gpio.OUT)
#Make an LED flash on and off forever
while True:
gpio.output(14, gpio.HIGH)
time.sleep(1)
gpio.output(14, gpio.LOW)
time.sleep(1)
INDENTATION IS WRONG... Everything in the while loop MUST be 4 spaces in or 1 tab....
Happy Piing!
Please subscribe and tell you friends of my videos!










