Hardware Reference
In-Depth Information
you can use. For example, libraries contain modules that you can use in your code, like
the sleep function from the time module that you used in previous adventures. In
this adventure, you use the GPIO library to sense and control the pins. To check
whether you have it, open an LXTerminal window from the desktop and type the fol-
lowing command:
sudo apt-get install python-RPi.GPIO
he Python library to control GPIO should be preinstalled on your Raspberry Pi. If you
are using an early distribution of Raspbian or another Pi operating system, however,
you may need to download and install it. To do so, follow the onscreen instructions, as
shown in Figure 8-5.
FIGURE 8-5 Downloading and installing the Python GPIO Library on the
Raspberry Pi
Do You Have a Rev 1 or a Rev 2
Board?
As I have mentioned, there are two versions of the Raspberry Pi GPIO pin layout: the
original Rev 1 and the newer, improved Rev 2. Before you start the exercises in this
adventure, you need to ind out which version your Raspberry Pi has. here is a simple
way to do this.
Search WWH ::




Custom Search