So, you’ve got yourself a Raspberry Pi mini-computer and are thinking to yourself: “Now what?” Maybe it was a gift. Maybe you’d heard about this “Raspberry Pie thingamabob” and decided to find out what all of the ruckus was about. Perhaps you’re already experienced with computers, but not with Linux or Python. Maybe you’re a Linux geek who’s never made a servo move or lit up an LED with just a few lines of code and the correct hardware and software installed. Or maybe you’re familiar with computers only to the point of checking your email and surfing the web but are eager to learn more. Or perhaps (one of my favorite scenarios) you’re an educator who’s interested in teaching the next generation about computers and programming and technology in general.
Whatever the case may be, welcome! You’re about to join a club—not a particularly exclusive one, I’m afraid, as the cost of joining is only about $35 US and a spark of creativity, but a club nonetheless—populated by students and teachers and hobbyists and artists and engineers. As a member of this club, you’ll be able to discuss package managers , ARM processors, and dot config files intelligently with whomever will listen to your babble. You’ll become familiar with servos, LEDs, and cameras-on-a-chip. And, perhaps most important, you’ll be able to connect to your new mini-computer, program it using one of many programming languages (although this book deals solely with Python), build projects, and interface those projects with the Pi, enabling it to interact with the physical world and do some pretty cool things.
With this book, I hereby induct you into this club. Your experience doesn’t matter, because I’ll lead you step-by-step through the process of setting up your Pi so you can work with it with a minimum of headaches. I’ll give you a solid background in Linux so you have an idea of what’s going on behind the scenes, and I’ll devote an entire chapter to Python, the deceptively powerful scripting language used by tech companies like Facebook, Google, and even NASA. I also plan to introduce you to the basic nuts and bolts of electronics, something that many tech-project books either gloss over or neglect completely. There are safety factors to consider (I’ve nearly had several small explosions as a result of shorting out LiPo batteries, for instance) as well as good building practices; you’ll learn the difference between a good and a bad solder joint, how to avoid slicing off your finger with an X-ACTO knife, and the difference between a 40Ω and a 40KΩ resistor.
Of course, if you’re already familiar with all of these introductory items, feel free to skip ahead to the good stuff—the projects. Most of them can be constructed in a weekend or so, and I’ve tried to keep the costs within reason as well. All are programmed in Python. At the beginning of each chapter, I’ll give you a shopping list and suggestions on where to buy the parts, and then we’ll start building. The projects don’t necessarily build on each other, nor do you have to do them in order, though they do tend to increase in complexity from the first project to the last.
What sorts of projects can you do with a Pi? A better question might be what sorts of projects can’t you do with a Pi. It’s been used for everything from web servers to car computers (carputers) to cluster computing to embedded machine vision devices to CNC controllers . . . the list just goes on and on. I hope that after finishing this book you’ll have some ideas of your own as well as the skills required to put those ideas into practice.
Whatever reason you have for picking up this book, your main objectives should be to have fun and to learn something. I hope I can help along the way!
The History of the Raspberry Pi
It may seem to some readers that the Raspberry Pi is new; there are a surprising number of people who have no idea what it is. Even now, seven years after the first Pi was produced, a large number of online articles begin with something along the lines of “The Raspberry Pi is a small, credit-card sized computer that hobbyists have begun using for . . .” This is in stark contrast to, say, the Arduino; most people who are up on current events have at least heard of it, even if they have no idea what it is or what it’s used for, since it’s been around since 2005 and has gained an immense, vocal following among hobbyists, geeks, and do-it-yourselfers around the world.
The Arduino
For those who don’t know, the Arduino is a microcontroller platform, available in many different form factors and sizes, mounted on a PCB that plugs easily into most computers’ USB ports. It allows the user to program the onboard Atmega chip to do various things via a C-like programming language in programs called sketches . A typical Arduino sketch might look something like this:
This program will move a connected servomotor (a small motor that can be controlled precisely via software) back and forth, with one-second delays between movements.
The Arduino is not as powerful as the Pi when it comes to computing power, but it’s also a completely different animal, as it’s a microcontroller, not a computer, so comparing them is a bit like comparing zebras and avocados. The two machines do, however, complement each other well, and I will discuss how to do that in Chapter 14.
As I said, the Raspberry Pi has been around for a few years—seven, to be exact. There are several different models available, with a new, improved version being released about once every other year.
The Pi’s creators—Eben Upton, Rob Mullins, Jack Lang, and Alan Mycroft—first floated the idea of a cheap PC for teaching purposes in 2006. They were all based at the University of Cambridge in the United Kingdom, and they were concerned that the demise of cheap personal computers like the Commodore 64, the Amiga, and the Spectrum was adversely affecting young people’s ability to program. With desktop and laptop machines costing hundreds or thousands of dollars, kids and teenagers were forbidden to practice programming on the family’s main computer for fear of breaking it.
At the same time, Upton and the others realized that many university computer science curricula had been reduced to “Microsoft Word 101” and “How to Create a Web Page Using HTML.” The four creators wanted to raise the programming knowledge bar of incoming students, and thus perhaps computer science and engineering courses would become a bit more robust and applicable to STEM fields in the real world.

Eben Upton’s 2006 Raspberry Pi prototype (image ©Raspberry Pi Foundation)
In 2008, the original four creators, along with Pete Lomas and David Braben, formed the Raspberry Pi Foundation (the Foundation), and three years later the first mass-produced Pi rolled off the assembly line.
Note
The name Raspberry Pi is a nod to the number of microcomputers named after fruit in the early days, such as the Apple and the Tangerine, and the Pi comes from the Python scripting language, which has always been an integral part of the Pi’s design.
Within a year, the Foundation had sold over one million units. The founding members have spoken many times about how they were dumbfounded by the explosive interest in their device. Their original goal of putting a cheap, programmable device in the hands of educators and their students has come to fruition, but the Pi has also become much more than that. Apparently, they were not the only people who were missing the ability to program on a cheaper machine; hobbyists around the world (including yours truly) flooded element14, Premier Farnell, and RS Electronics with orders—to the point that people who had pre-ordered their Pi had to wait up to six months for supply to catch up with demand. (As of this writing, one of the latest models of the Pi, the Pi Zero W, is still only available on a one-per-customer basis.) Many customers may have been current or former programmers, eager to play with a new, small, powerful computer. I, for instance, first learned to program in BASIC on the Commodore VIC-20, a computer with an impressive 5KB of RAM.
We’ve had enormous interest, support, and help from the educational community, and we’ve been delighted and a little humbled by the number of enquiries from agencies and people far away from our original targets for the device. Developing countries are interested in the Raspberry Pi as productivity devices in areas that simply can’t afford the power and hardware needed to run a traditional desktop PC; hospitals and museums have contacted us to find out about using the Raspberry Pi to drive display devices. Parents of severely disabled kids have talked to us about monitoring and accessibility applications; and there seem to be a million and one people out there with hot soldering irons who want to make a robot.
Luckily, for the most part, supply has securely caught up with demand. There is no waiting period to buy a Pi anymore, and with the exception of the Zero W there is no longer a limit of one per customer. There are countless “hats” available (form-fitting aftermarket add-on boards with various capabilities), as well as a camera board and an official touchscreen display that both plug into the ports on the Pi. The founders have also actively encouraged other companies to copy their paradigm, and that has probably been largely responsible for the current number of small single-board computers available today.
Exploring the Pi
It is no longer possible to write just a single section that claims to exhaustively illustrate the Pi’s built-in parts and design, as there are many different designs available. I will, however, keep this section small by addressing only the three most recent releases: the Pi version 3, the Zero, and the Zero W. As it happens, the Zero and the Zero W have almost identical setups, so we need only describe one of the two. The price point of all of these boards has remained low; the version 3 is currently about $35US, the Zero is about $5, and the Zero W is $10. On March 14, 2018, also known as Pi Day, the Raspberry Pi Foundation released an update to the Pi version 3, the 3 B+. This newer version offers a few upgrades to the original version 3, including dual-band WiFi, a slightly faster CPU (1.4GHz), and power-over-Ethernet (PoE) capabilities. As this version is still very new, as its form factor is almost identical to the original version 3, and as its upgrades won’t affect any of the projects in this book, I won’t mention it beyond this point.
The size of the Pi hasn’t changed over the years; the Pi 3 measures the same as the Pi 1: 85.6mm x 56mm x 21mm. The Pi Zero and Zero W are a bit smaller: 30mm x 65mm x 3.5mm (not having USB and Ethernet ports makes a huge difference in thickness). The newest Pi is a bit heavier—45 grams versus the original’s 31 grams—but luckily weight probably doesn’t factor in when you’re trying to fit the new Pi into your old case or project design.

The Raspberry Pi 3
The GPIO Pins
As you can see in the figure, there’s a lot packed onto the board’s small space. You can see, running along the top, one of the biggest improvements from the Pi’s early version to the current models: the increase from 26 to 40 GPIO (General Purpose Input/Output) pins. These pins allow you to connect the Pi to any number of physical extensions, from LEDs and servomotors to motor controllers and extension boards (often referred to as “hats”). With a normal desktop or laptop, interfacing with physical devices like those is nigh impossible, as the serial port has all but disappeared on newer devices, and not everybody is capable of writing low-level device drivers for the USB port. The Pi, however, comes with libraries pre-installed that allow you to access the pins using Python, C, or C++, and there are additional libraries (e.g., PiGPIO and ServoBlaster) available if you don’t care for the preinstalled versions .
USB & Ethernet
The next thing we come to along the outside edge is the two pairs of USB ports and the Ethernet port. These are both connected to the LAN9514 (the chip just to the left of the USB ports), which supplies USB2.0 and 10/100 Ethernet connectivity. As with all other Pis, the chip acts as a USB-to-Ethernet adapter, which is what allows the onboard Ethernet to work.
Audio Jack
The 3.5mm audio jack on the board can be used with any standard pair of headphones. HDMI sound is delivered, if available, via the HDMI connector. Sound output is also available via I2S. I2S is beyond the scope of this book, but is a serial interface standard used for connecting digital audio devices together.
Camera Connector

The Raspberry Pi camera board
HDMI
Following the camera board connector is the Pi’s HDMI (High-Definition Multimedia Interface) port. Many Pi aficionados argue that this is where the Pi distinguished itself from the beginning, as it has always been able to display high-definition graphics. The newest version of the Pi has a 400MHz Broadcom VideoCore IV GPU onboard, enabling it to output full HD video at up to 60fps. It can support Blu-Ray quality playback and supports OpenGL and OpenVG libraries on the chip, and while it does not have H.265 decoding hardware, the GPU runs fast enough that it may be able to decode H.265 in software.
Power
Continuing clockwise, we come to the micro-USB power input port. Similar to previous versions of the Pi, you can probably use a standard cell-phone charger to power your Pi, but make sure it can source at least 2A. The Pi 3 may not use that much current on its own, but it definitely can if four devices are plugged into the four USB ports.
You can also power the Pi with batteries (I tend to use LiPos), but a word of warning: The Pi has no onboard power regulator! If you’re used to using the Arduino, you know that you can plug in a 9V battery and go on your way. If you try that with the Pi, you’ll be greeted by a puff of the magic smoke and will need to buy a new Pi. I’ll discuss voltage regulators in projects where a mobile Pi is a necessity.
Display
The final connector on the top side of the board is the DSI display connector, which is used for connecting the official Raspberry Pi 7” touchscreen display. This display was released in 2015, finally satisfying the needs of Pi enthusiasts who needed an easy way to interface with the Pi without having to lug around a huge monitor and a keyboard. If you don’t have a display or don’t need a touchscreen interface, you’re still free to use a normal HDMI monitor and a USB keyboard and mouse.
The System on a Chip
The most important piece on the whole Pi is the large black chip in the middle, also referred to as an SoC, or System on a Chip . The Pi’s chip is a Broadcom PCM2837, with a 1.2GHz ARM Cortex A53 quad-core cluster. It’s a huge improvement over even the most recent Pi, with the most improvements being made in multi-threaded processing. The one tradeoff, unfortunately, is that the new chip draws a lot more power. If you’re looking for low power usage, you may be better off with an older model or with the Zero or Zero W.
SD Card
Finally, on the bottom of the board is the microSD card slot. One of the Pi’s greatest space-saving features is its lack of a real hard drive. The SD card acts like a solid-state drive (SSD). This form factor has varied over the course of the Pi’s versions; the current version takes microSD cards only and is not spring-loaded. You’ll need to use at least a 4GB card to get a minimal install of Raspbian (the Pi’s preferred OS) to work on the Pi, and 8GB is recommended. I’ve been able to use up to 64GB cards on the Pi, but your results may vary depending on the card’s manufacturer. Stick with brand-name cards if you’re worried about data degradation or boot failures.
Not Visible
One thing not visible on the Pi 3’s board is its built-in WiFi and BLE (Bluetooth Low Energy) capabilities. These are supplied by a Broadcom BCM43438 chip, which provides 2.4GHz 802.11n wireless LAN, BLE, and Bluetooth Classic 4.1 radio support. This, to me, is a huge improvement over the original Pi, as I no longer have to purchase and configure a USB WiFi converter and lose a USB port at the same time, and Bluetooth compatibility is a huge convenience when it comes to building applications for the Internet of Things (IoT).
The Pi Zero/Zero W

The Pi Zero W
Let’s take a quick look at everything the Zero W offers.
GPIO
The first thing you’ll probably notice is the lack of headers. In order to cut the cost, since you’re only paying $5US for the Zero and $10 for the Zero W, the Pi Foundation decided that you’ll have to solder on the headers yourself. It’s a small price to pay, since it still boasts 40 pins, and the pinout is the same as that for the full-size Pi.
Camera Connector
Continuing clockwise around the board, you’ll find the connector for the Pi camera board. The difference here is the form factor: the Zero’s connector is quite a bit slimmer than the one on the Pi 3. The Zero still uses the same camera board, but the cable connection is different. If you plan to use your Pi camera with your Zero, make sure you order an adapter cable, sold by most places that sell Pi accessories.
Power
On the bottom of the board you’ll see two micro-USB ports. The first of these, next to the camera connector, is for power in, just like the larger Pis. A standard cell-phone charger should do well here, as the Zero does not require much current. Again, like the Pi, it does not have a voltage regulator on board, so make sure you’re only giving it a clean 5V of power.
USB
Next to the power micro-USB connector is the micro-USB port. To use most peripherals with your Zero, you’ll need to purchase a micro- to standard-USB hub. Make sure you get one that doesn’t require external power, unless you plan to use power-hungry devices like webcams with the Zero. In that case, you’ll need a powered hub, since the Zero can’t source much current.
HDMI
Continuing clockwise, after the micro-USB port is the mini HDMI port, which (obviously) will require a mini HDMI adapter. The Zero does not have a separate GPU like the larger Pi does, but it’s still capable of full 1080p output through this port.
SD Card
Finally, the microSD card slot is the last thing on this tiny little board. Like the larger Pi, you’ll need at least a 4GB card to do anything worthwhile on the Zero, and I’d really recommend 8GB or larger.
System on a Chip
The large black chip in the center of the board is the Broadcom PCM2835 with an ARM11 processor running at 1GHz. If those specs sound familiar, they should: it’s the same chip that was packaged on the original Raspberry Pi, just running a bit faster. The price point has sunk a bit, enabling it to be placed on a lower-power board like the Zero.
Not Visible
Like the Pi 3, one of the unsung heroes of the Zero W is the built-in 2.4GHz 804.11n LAN, BLE, and classic Bluetooth 4.1 capabilities. The radio chip is the same as on the Pi 3, but the antenna is a little different and bears a quick look, I think. If you look closely at the edge of the board between the USB out and the mini HDMI port, you’ll see a small triangle. That triangle is actually cut into the layers of the PCB and is a resonant cavity, just the right size to interact with WiFi radio waves. It’s an ingenious idea and helps keep the Zero small and cheap.
The Zero and the Zero W are both incredible pieces of cheap equipment, and if you plan to do any work at all with the Pi, I highly recommend picking up one or more of each. For the price, you really can’t beat what you can do with both of them.
Comparing the Raspberry Pi to Similar Devices
You may ask, again, what makes the Pi superior to other small microcomputers like the Arduino and perhaps the Beagleboard line of devices? The answer is that the Pi isn’t necessarily better; each of these boards fills a particular niche, and it can be difficult to compare them, especially with microcontrollers like the Arduino. Arduinos are awesome for creating simple projects, and even for controlling a very simple robot, and in many cases using a Pi for such purposes would be overkill. As for the other microcomputers out there, one of the main differences is the price. A close relative to the Pi is the Beagleboard, but the suggested price for that board is over $75—much more than the Pi. And purchasing the Raspberry Pi means you’re supporting a charitable organization aiming to put cheap computers in the hands of schoolchildren worldwide, so there’s that, too.
Getting Started with the Pi
I think you’d agree that now is as good a time as any to take the Pi out of the box, if you haven’t already. Just read on before you start it up.
Hardware Requirements of the Pi
Let’s take a quick look at what the Pi’s requirements0 are, and then we’ll start it up. For the purposes of this chapter—indeed, most of the book—I’ll be assuming that you, the reader, are using the Pi 3 rather than the Zero. Most things will remain the same; if there are noticeable differences, such as in power requirements, for example, I’ll be sure to mention them.
Connecting to Power
I already mentioned power; the Pi needs 5V—no more, no less. Again, because it bears repeating: The Pi has no onboard voltage regulator! You can’t plug in a 9V battery or wall wart and expect it to work. Either use something like a cell-phone charger that puts out 5V or get a good power supply from an online electronics store or the place where you bought the Pi. The power supply should also put out at least 1.5A, and preferably 2A. If it doesn’t source enough power, be prepared for some funky behavior on the part of your Pi, like the mouse and keyboard not working or even a complete failure to boot.
Adding a Monitor
The next peripheral you’ll need, at least at first, is a monitor with either HDMI or DVI capabilities. If all you have is DVI input, that’s alright, because HDMI-to-DVI converters are everywhere. After you’ve got it set up and all the necessary software is installed, you can run the Pi in a headless configuration. What that means is that you can log into it from another computer on the same network with either SSH (Secure Shell) or even a VNC (Virtual Network Computing) client. But at first you’ll need a monitor so you can see what you’re doing. Baby steps.
Adding a USB Hub
You may want to add a USB hub at some point, though the Model 3 has four USB ports. If you’re using a Zero, you’ll definitely need one, at least at first. Performance can get a bit finicky when you add a hub because some USB hubs have been shown to work much better than others when it comes to working with the Pi. Perhaps the most important necessary feature is that the hub is externally powered; this will prevent your Pi from having to provide enough power to whatever power-sucking device you’ve decided to plug in that day. If you don’t have a spare hub floating around and are unsure of what to try, the Raspberry Pi forums are often a good place to start looking ( http://www.raspberrypi.org/phpBB3 ). It’s here that users like you have tried umpteen different brands and reported back about which ones work, which ones don’t, and which ones require a little tweaking. Luckily, hubs are relatively inexpensive, so if the first one you try doesn’t work, you can use it elsewhere and try a different one with your Pi.

MakerSpot mini USB hub
However, here is where you should do as I say, not as I do, because this particular hub is not externally powered. It does do everything I need it to without causing my Zero to suffer from brownouts (weird behavior due to insufficient power), so feel free to copy my success with it.
Now that you’ve outfitted your Pi with all of the necessary external parts, you’re ready to start setting it up.
The Pi Operating System
The Raspberry Pi’s default operating system (OS)—the one it’s designed to use—is Linux. The Pi 3 can run an IoT version of Windows 10, but setting it up can be a bit tricky, and in my experience the Pi just runs better with Linux. If you’re not familiar with the Linux operating system, don’t worry—we’ll peek under the hood in Chapter 2. For now, though, know that Linux comes in several flavors, or distributions: Ubuntu (one of the most popular), Debian, Mint, Red Hat, Fedora, and a few other more obscure varieties. The Pi uses a version of Debian called, appropriately enough, Raspbian.
Because the Pi doesn’t have a hard drive, you must download and copy a disk image to an SD card. That image is what the Pi will use to boot, and it will also act as memory/RAM. Almost any size card will do, as long as it’s at least 4GB, and more than 8GB is preferred if you plan on loading an appreciable amount of extra software onto the card (yes, you will end up doing just that). As I mentioned earlier, cards of up to 64GB have been shown to work just fine; beyond that, your results may vary. It’s recommended that you use a brand-name card, and it should be a class 4, which denotes the speed of the card.
Formatting the Card
For Windows users: Download the formatting-tool program from the SD Association at https://www.sdcard.org/downloads/formatter_4/eula_windows/ . Install it using all the default settings and start it up. Set the “FORMAT SIZE ADJUSTMENT” option to “ON” in the tool’s Options menu, make sure you have the right SD card selected, and click “Format.”
For Mac users: Download the Mac version of the formatting tool from https://www.sdcard.org/downloads/formatter_4/eula_mac/ . Install the tool with all the default settings by double-clicking the downloaded .pkg file. Once it’s installed, open it and select the “Overwrite Format” option. Make sure you have the right SD card selected and click “Format.”
Installing the OS
Now that the card is formatted correctly, you can put the operating system on it. Most users can use the Pi Foundation’s NOOBS (New Out Of Box Software) from http://www.raspberrypi.org/downloads . If you prefer, however, you can just download the Raspbian image itself. There is even a Raspbian Lite OS that has a much smaller memory footprint, ideal for smaller systems like the Zero and the Zero W. The NOOBS system, upon first boot, will actually present you with a choice of operating systems to install, including two versions of XBMC (Xbox Media Center), Pidora, and Raspbian. For the purposes of this book and the subsequent chapters, we’re going to install Raspbian.
Once you’ve downloaded your choice of OS (NOOBS: 1.3GB; Raspbian: 1.7GB), unzip it using the extraction utility of your choice (Windows: right-click, “Extract all”; Mac: double-click). Then, copy the extracted files onto your SD card.
That’s it. Your Pi is now ready to boot.
Connecting the Peripherals
- 1.
Insert the SD card.
- 2.
Connect the monitor.
- 3.
Connect the USB peripherals (keyboard, mouse, hub).
- 4.
Connect the Ethernet cable.
- 5.
Connect the power.
As a matter of fact, the most critical detail to remember here is to hook up the power last. You can probably fudge on the others, but power should always be last.

Pi rainbow startup screen
This screen is actually generated by the Pi’s firmware as it initializes the onboard GPU. The GPU draws four pixels on the screen and then embiggens them, resulting in the multicolor square. You should see it for only a brief moment, followed by a scrolling list of text as the Pi continues its boot process.
Configuring the Pi

The Pi’s default desktop
Once your Pi has booted and you’re at the desktop, one of the first things you should probably visit is the Software Configuration Tool, also known as raspi-config . This can be reached by typing
in a terminal. (To start a terminal, click the Terminal icon in the menu bar.) This tool allows you to make changes to configurations, like expanding the filesystem, enabling SSH and the camera, and setting your Pi’s locale. This last, accessible from the Localisation Options submenu, is more important than you think, as the Pi’s default locale (and associated keyboard layout) is in the United Kingdom, which means that if you’re in the United States, you’ll be unpleasantly surprised the first time you press Shift > 2, expecting to get the “@” symbol, and are greeted instead with the double quotation mark (“).

raspi-config
When you’re done playing with raspi-config, select “Finish” and press Enter.
Your Pi is now up and running. Congratulations, give yourself a pat on the back! Enjoy, but don’t get too comfy. Your next task should be to make sure everything is up to date. Most Linux distributions release updates and upgrades regularly, and Raspbian is no different. There’s a good chance there have been several important upgrades to the software and possibly the kernel between the time the Pi Foundation made the NOOBS or Raspbian image available for download and today.
To update the Pi, make sure your Ethernet cable is plugged in and start a terminal (either click the terminal icon or press Ctrl–Alt–T.) At the prompt, type
You’ll see lines of text flow smoothly by as the Pi refreshes its software list. When it finishes, the “$” prompt will return. At this point, type
Again, lines of text should scroll past. If new software is ready to be downloaded, the Pi will ask you if you want to download and install it. Press Enter (the default option). When it finishes and returns you to the $ prompt, everything should be at the latest version. Depending on what was updated, you may be prompted to restart. Do so, and you’ll be up to date.
Note
When you see the “$” character when I prompt you to enter text in the terminal, you shouldn’t actually type the dollar sign. It’s the prompt that appears in the terminal due to the shell environment you’re using.
Shutting Down the Pi
Before we begin our Linux discussion, let’s discuss shutdown. As a matter of fact, shutting down the Pi is really unnecessary; it’s such a low-power device that designers just expect that you’ll leave it running. You can shut it down, though, and in the interest of saving a little money and perhaps your Pi, I suggest you shut it down when you’re done using it. Since there’s no “Off” switch, the Pi is actually designed to be powered off simply by unplugging it, and nothing bad is supposed to happen (assuming you’ve saved your work, aren’t in the middle of something, and so on). But just unplugging it makes many of us computer types cringe, so let me teach you the true, proper shutdown method. Open the terminal and at the prompt type
This takes the processor through the proper shutdown sequence, killing running processes, stopping threads, and so on. When it’s finished, it’s really safe to unplug the Pi.
If you want to reboot from the terminal, typing
will reboot the Pi.
Summary
You’ve now been introduced to the Pi, installed its operating system, and updated it to within an inch of its life. You’ve also been introduced to the raspi-config tool, and you have even played a bit with the command-line interface (CLI). It’s time to take an in-depth look at Linux.























































































































