These GPIO pins can be accessed for controlling hardware such as
LEDs, motors, and relays, which are all examples of outputs. As for
inputs, your Raspberry Pi can read the status of buttons, switches,
and dials, or it can read sensors for things like temperature, light,
motion, or proximity (among many others).
With the introduction of Raspberry Pi 1 Model B+, the
number of GPIO pins increased from 26 to 40. If you
have one of the first Pis, you can still carry out the
examples in this chapter as they’ll use only the first 26
pins on the GPIO header.
The best part of having a computer with GPIO pins is that you can
create programs to read the inputs and control the outputs based
on many different conditions, as easily as you’d program your
desktop computer. Unlike a typical microcontroller board, which
also has programmable GPIO pins, the Raspberry Pi has a few
extra inputs and outputs, such as your keyboard, mouse, and
monitor, as well as the Ethernet port, which can act as both an
input and an output. If you have experience creating electronics
projects with microcontroller boards like the Arduino, you have a
few more inputs and outputs at your disposal with the Raspberry
Pi. Best of all, they’re built right in; there’s no need to wire up any
extra circuitry to use them.
Having a keyboard, mouse, and monitor is not the only advantage
that Raspberry Pi has over typical microcontroller boards. There
are a few other key features that will help you in your electronics
projects:
Filesystem
Being able to read and write data in the Linux filesystem will
make many projects much easier. For instance, you can con-
nect a temperature sensor to the Raspberry Pi and have it take
a reading once a second. Each reading can be appended to the
end of a log file, which can be easily downloaded and parsed in a
90 Getting Started with Raspberry Pi
GSW_RASPI_4ED_FIN.indd 90GSW_RASPI_4ED_FIN.indd 90 10/28/21 10:54 AM10/28/21 10:54 AM