Raspberry Pi – Using the GPIO…
Part 1:
Here is how to use your Raspberry Pi’s GPIO pins… Part 1. Make sure to watch Part 2:
EDIT: I apologise for the quality of the video, as well as the quality of my tutorial; this was one of my early tutorials and as you can see I was not very experienced at all! Please have a look at some of my later videos, the quality of them is a lot higher!
Commands used:
sudo apt-get install python-rpi.gpio
And if needed:
sudo apt-get install python-dev
Code is as follows (Be careful though the indentation may be wrong!):
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)
Happy Piing!