Preface
Ten years.
It’s been ten years since the Raspberry
Pi was first announced in 2011. And what
a decade it has been. A credit-card–sized
computer for $35? That I can hook up to
my existing monitor and keyboard setup?
And connect to physical things via GPIO
pins? It seemed like a pipe dream. This is why,
when it started shipping, the Rasp berry Pi
created a frenzy of excitement.
Demand outstripped supply for months, and the waitlists for these
mini computers were very long. Some of their newest products
(and not-so-new) like the Pi Zero W and the Pi 4 still have limited
availability; it’s difficult to find a place that will sell more than two Pi
Zeros to a customer. Besides the price, what is it about the Rasp-
berry Pi that tests the patience of this hardware-hungry mass
of people? Before we get into everything that makes the Raspberry
Pi so great, let’s talk about its intended audience.
Eben Upton and his colleagues at the University of Cambridge
noticed that students applying to study computer science didn’ t
have the skills that they did in the 1990s. Students were consider-
ing themselves skilled at what they called “computer science” when
all they could do was use MS Word and Excel and perhaps write
a little HTML and perhaps JavaScript.
Upton and the others attributed this to—among other factors—
the “rise of the home PC and games console to replace the Amigas,
Preface ix
GSW_RASPI_4ED_FIN.indd 9GSW_RASPI_4ED_FIN.indd 9 10/28/21 10:53 AM10/28/21 10:53 AM
BBC Micros, Spectrum ZX, and Commodore 64 machines that peo-
ple of an earlier generation learned to program on.
1
Because the computer has become important for every member
of the household, it may also discourage younger members from
tinkering around and possibly putting such a critical tool out of
commission for the family. Parents don’t want their children “hack-
ing” the family computer while learning to program, because they-
run the risk of possibly breaking it.
Meanwhile, mobile phone and tablet processors had become less
expensive while getting more powerful, clearing the path for the
Raspberry Pi’s leap into the world of ultra-cheap-yet-serviceable
computer boards. The ARM chip family that’s used in all of the Pi
boards got its main start inside mobile phones.
As Linus Torvalds, the founder of Linux, said in an interview with
BBC News, the Raspberry Pi makes it possible to “afford failure.
If a child (or an adult) manages to brick the Pi, he or she can just
buy another one, for far less than the cost of replacing a laptop.
2
Raspberry Pi Foundation
It’s important to note that Raspberry Pi primarily exists to advance
the charitable mission of the Raspberry Pi Foundation. That mis-
sion is to “put the power of computing and digital making into the
hands of people all over the world. The Raspberry Pi Foundation
hopes that people—kids especially—will learn to code, learn how
computers work, and learn how to make things with computers.
With every Raspberry Pi purchase you make, you’re not only pay-
ing for the cost of the hardware, fulfillment, and the engineering
behind it, you’re also contributing the free online resources, free
teacher training, and special programs that the Raspberry Pi Foun-
dation offers to further its charitable mission.
As you’ll learn in this book, the Raspberry Pi is great for learning,
but it also makes for a powerful tool. Even if the primary
1 About us, Raspberry Pi Foundation (www.raspberrypi.org/about).
2 Leo Kelion, “Linus Torvalds: Linux Succeeded Thanks to Selfishness and Trust,
BBC News, June 12, 2012.
x Preface
GSW_RASPI_4ED_FIN.indd 10GSW_RASPI_4ED_FIN.indd 10 10/28/21 10:53 AM10/28/21 10:53 AM
purpose of the board is for education, we find that its utilization
stretches into commercial and industrial applications. Companies
use it for things such as sensor networks, remote monitoring, and
product prototyping. Even though the Raspberry Pi is great for
kids, you should keep in mind that it’s a real computer. It’s not a toy
or some kind of watered-down device.
What Can You Do with It?
One of the great things about the Raspberry Pi is that there’s no
single way to use it. Whether you just want to watch videos and
browse the Web, or you want to hack, learn, and make with the
board, the Raspberry Pi is a flexible platform for fun, utility, and ex-
perimentation. Here are just a few of the different ways you can use
a Raspberry Pi:
General-purpose computing
It’s important to remember that the Raspberry Pi is a general-
purpose computer and you can, in fact, use it as one. The Pi ver-
sion 4.0 (the most recent release as of this writing), with 8GB
of RAM and two HDMI outputs capable of 4K 60fps, is power-
ful enough to completely replace most general users’ desktop
computers. After you get it up and running in Chapter 1, you can
launch a web browser to access email, news sites, and social
networks, which is a lot of what we use computers for these
days. Going beyond the Web, you can launch the free and open-
source LibreOffice
(
www.libreoffice.org
)
productivity suite,
which allows you to work with documents and spreadsheets
when you don’t have an internet connection.
Learning to program
Because the Raspberry Pi is meant as an educational tool to
encourage kids to experiment with computers, it comes pre-
loaded with interpreters and compilers for many different pro-
gramming languages. If you’re eager to jump into writing code,
the Python programming language is a great way to get started,
and we cover the basics of it in Chapter 4. But with Raspberry
Preface xi
GSW_RASPI_4ED_FIN.indd 11GSW_RASPI_4ED_FIN.indd 11 10/28/21 10:53 AM10/28/21 10:53 AM
Pi, you’re not limited to only Python. You can write programs for
your Raspberry Pi in many different programming languages,
including C, Ruby, Java, and Perl.
All newer versions of the Raspberry Pi OS come pre-installed
with Scratch, a programming environment meant to introduce
younger users to programming concepts. There’s even a pro-
gramming language and development environment for creat-
ing music called Sonic Pi.
Project platform
The Raspberry Pi differentiates itself from a regular computer
not only because of its price and size, but also because of its
ability to integrate with electronics projects. Starting in Chap-
ter 6, we’ll show you how to use the Raspberry Pi to control
components from LEDs to AC devices, and you’ll learn how to
read the state of buttons and switches.
Product prototyping
More and more electronics products use Linux computers in-
side, and now this world of
embedded Linux
is more accessible
than ever. Let’s say you create something with your Raspberry
Pi that would make a great product for the every-day consum-
er. With the
Raspberry Pi Compute Module
(a smaller version
of the board that we’ll discuss later), it becomes possible to
create a product that’s powered by Raspberry Pi. Companies
can also use the smaller Pi versions like the Zero and Zero W
for products and prototypes where a full-size Pi is either too big
or too expensive to make a good fit.
xii Preface
GSW_RASPI_4ED_FIN.indd 12GSW_RASPI_4ED_FIN.indd 12 10/28/21 10:53 AM10/28/21 10:53 AM
Raspberry Pi for Makers
As makers, we have a lot of choices when it comes to platforms
on which to build technology-based projects. Microcontroller
development boards like the Arduino (and the new Raspberry Pi
Pico RP2040) have long been a popular choice because they’ve
become very easy to work with. But
system on a chip
platforms like
the Raspberry Pi are a lot different than traditional microcontrollers
in many ways. It’s a common misconception that the Pi and a
microcontroller are interchangeable; in fact, they are completely
different devices that fulfill totally different functions. The Raspberry
Pi is a computer, like your desktop computer, while the Arduino
is a microcontroller that has no business trying to replace a Dell
or an iMac.
This is not to say that a Raspberry Pi is
better
than a traditional
microcontroller; it’s just different. For instance, if you want to make
a basic thermostat, you’re probably better off using an Arduino
Uno or similar microcontroller for purposes of simplicity. But if you
want to be able to remotely access the thermostat via the Web to
change its settings and download temperature log files, you should
consider using the Raspberry Pi.
Choosing between one or the other will depend on your project’s
requirements, and, in fact, you don’t necessarily have to choose
between the two. In Chapter 5, we’ll show you how to use the
Raspberry Pi to program the Arduino and get them communicating
with each other. Many projects—built by both hobbyists and
professional engineers—require both a controlling CPU like the Pi
and a microcontroller like the Arduino.
As you read this book, you’ll gain a better understanding of the
strengths of the Raspberry Pi and how it can become another use-
ful tool in the maker’s toolbox.
Preface xiii
GSW_RASPI_4ED_FIN.indd 13GSW_RASPI_4ED_FIN.indd 13 10/28/21 10:53 AM10/28/21 10:53 AM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset