User Manual

21
RPi.GPIO Introduction
RPi.GPIO is a module to control Raspberry Pi GPIO channels. This package provides a class
to control the GPIO on a Raspberry Pi. For examples and documents, visit
http://sourceforge.net/p/raspberry-gpio-python/wiki/Home/
Raspbian OS image of Raspberry Pi installs RPi.GPIO by default, so you can use it directly.
You might want to install the python-dev package.
sudo apt-get install python-dev
Next, use C and Python language to program. You will learn how to use wiringPi and RPi.GPIO
module to control Raspberry Pi GPIOs. Take blinking LED for example. First, connect circuit
according to the following diagram:
Note: The resistance of the resistor here is 220Ω. If the resistance is too high, the LED will be
too dim or even won’t light up.
For C language users (based on the wiringPi library):
Step 1: Create a C file named led.c
touch led.c