A
website, 136
ADC (Analog to Digital Convertor) chip, 120
autonomous rover, 155–160
B
bandwidth, Internet, 143
battery box, 5V USB battery pack, 150
Beginning Game Development with Python and Pygame, 97
blog site with how-to posts, 20
bookshelf, File Manager, 15
breadboard
half-sized, 156
layout for project, 130
photoresistor, 121–122
putting LED on, 114
built-in function input, 48
C
camera, 146
catch detection, 104
channels of LED, 129
chassis, robot, gear motors, 150
classes, 63–72
commercial Raspberry Pi cases, 8
comparison operators, 33
comparisons, 33
connection command line tool, 147
connection command line tool, SSH (Secure SHell), 147
console, serial, 146
contents of bookshelf, as shown in File Manager, 15
D
date, time in, mode of display, 140–141
days remaining in year, countdown, 144
del(a[i:j]), 59
del(d[key]), 60
desktop, pixel, Raspberry Pi 4, 2
dictionary functions, 60
digital inputs, 119–120
DRY (Don’t Repeat Yourself), programming principle, 36
E
e-mails in inbox, number of, 143
editor, 23–26
EEPROM (Electrically Erasable Programmable Read-Only Memory), 112
electronics, before connecting, checking wiring, 113
enabling interfaces, 146
encapsulation, term, 67
F
female-to-male jumper cables, 130
female-to-male jumper wires, 112, 156
File Manager, bookshelf, 15
file system, 77–78
files, 73–78
Internet, 73–84
float(x), 60
following mouse, 101–102
four-digit seven-segment 12C display, 136
functions of Raspberry Pi, 3
G
games programming, 97–108
gear motors, robot chassis, 150
get(key default), 60
getting started, 13–20
GPIO 3 SCL, display SCL, 137
GPIO 2 SDA, display SD, 137
GPIO GND, display GND, 137
GPIO pins
burning out, 113
connect breadboard to, 114–117
GPIO 5V0, display VCC, 137
graphical user interface (GUI), 85–96
user interface, window sliders, 131
H
half-sized breadboard, 156
Hangman program, 73
hardware, 121–122, 151, 156–158
hardware assembly, Raspberry Pi, 136–138
Hardware Attached Top. See HATs
hardware interfacing, 109–128
HATs, 126–127
“Hello” printing function, 45
Hello Pygame, 98–99
“Hello World” message, 85
home page, Raspberry Pi Foundation, 20
homemade Raspberry Pi, 8
hours, mode of display, 140–141
I
inbox, number of e-mails, 143
init (short for initialize), 99
input in Python 2 and Python 3, 46
inputs, digital, 119–120
installing example programs, 30
installing Raspberry Pi OS, 11
Internet
bandwidth, 143
files, 73–84
int(x), 60
J
JSON file, reading contents of, 79
jumper cables, female-to-male, 130
jumper wires, female-to-male, 156
K
key in d, 60
“kitchen sink” user interface, 90
L
LAN, 147
lead colors, 137
LED
channels of, 129
putting on breadboard, 114
RGB common cathode, 130
LED fader project, 129–134
len(d), 60
library
importing, 116
PiAnalog, 122
“time,” 116
list functions, 59
list(x), 60
Local Area Network. See LAN
looping, 28
lots of raspberries, 105–108
M
making program display message of “Hello World,” 85
math.factorial(n), 57
math.log(x), 57
math.pow(x, y), 57
math.sin, cos, tan, asin, acos, atan, 57
math.sqrt(x), 57
McGugan, Will, 97
measuring resistance, 124–126
MenuBar control, 94
minutes, mode of display, 140–141
modules, 63–72
MonkMakes, 130
MonkMakes Project Box, 122
Motor Controller pHAT, 147
motor driver, PiHut, 150
motor driver pHAT, 150
Mu
creating text file, 74
initial starting, 22
text file, 74
multiple assignments, 55
multiple return values, 55–56
N
naming variables, 27
navigating with Terminal, 17–18
number of e-mails, inbox, 143
number of visitors to website, 144
numbers, function use with, 57
O
object orientation, 65–66
oct(x), 57
O’Hanlan, Martin, 85
outputs, analog, 117–119
P
PCB mount push switch, 136
pHAT, motor driver, 150
photoresistor, breadboard, 121–122
physics string theory, programming string, contrasted, 39
pin functions, 110–111
pins labeled GND (ground), 111
pixel desktop, Raspberry Pi 4, 2
Pi Zero W, Raspberry, 150
polite_sentence, 45
port, serial, 146
power pins, 111
principle in programming is DRY (Don’t Repeat self), 36
programming string, physics string theory, contrasted, 39
prototyping project (clock), 135–144
pulse width modulation, 117–119
Putty, Windows, SSH (Secure SHell), 147
pwd command, 17
pygame, coordinate system, 98
Python
basics, 21–38
libraries, 65
shell, 22–23
versions, 22
Python 3, input in, 46
Python 4, input in, 46
Python in Terminal, 37
R
random numbers Python, 29
rangefinder, 158–160
Raspberry Pi
analog inputs, 120–126
analog outputs, 117–119
applications, 19–20
autonomous rover, 155–160
blog site with how-to posts, 20
booting up, 9–12
breadboarding with jumper wires, 112
case, 7–9
catch raspberry, 104
classes, 63–72
command line, 16–19
command while, 35–36
commercial Raspberry Pi cases, 8
connecting everything together, 9–10
connecting to Raspberry Pi over VNC, 148
connections, 9–10
coordinates, 97–98
defining classes, 66–68
desktop, 14–16
dictionaries, 53–54
digital inputs, 119–120
digital outputs, 112–117
display, 7
displays time, 138
editor, 23–26
enabling interfaces, 146
equipment to purchase, 5–9
ethernet patch cable, 6
files, Internet, 73–84
files and Internet, 73–84
functions, 44–45
functions of, 3
games programming, 97–108
getting started, 13–20
GPIO pin connections, 109–112
GPIO pins, burning out, 113
graphical user interfaces, 85–96
GUI widgets, 89–91
guizero, 85
Hangman, 45–53
hardware, interfacing, 109–128
hardware assembly, 130–131, 136–138
HAT pins, 112
hat pins, 112
HATs, 126–127
headless Raspberry Pi, 146
Hello Pygame, 98–100
Hello World, 85–86
home page of Raspberry Pi Foundation, 20
homemade, 8
http://elinux.org/RaspberryPiBoard, 20
if command, 32–35
inheritance, 68–70
installing Raspberry Pi OS, 11
interfacing hardware, 109–128
Internet, 80–83
files, 73–84
Internet resources, 20
JSON, 79–80
kit, 6
LED clock using, 135
LED fader project, 129–134
Linux, 13–14
lists, 41–44
loops, 28–29
menus, 94–95
methods, 63–72
micro-HDMI to HDMI, 6
model 4, 110
motor driver pHAT, PiHut, 150
Mu, 21–26
arithmetic in REPL, 23
editor, 23–26
REPL, arithmetic in, 23
running program, 25
saving hello.py program, 25
shell, 22–23
version, 22
numbers, 26
outputs, analog, 117–119
peripherals, verified, 20
phase two, 140–143
Raspberry Pi (Cont.)
pickling, 78
pop-ups, 91–94
power supply, 5–7
prototyping project (clock), 135–144
pygame, defining, 97
Python basics, 21–38
Python versions, 22
rangefinder, 158–160
raspberry game, 100–108
Raspberry Pi OS, installing, 11
Raspberry Pi Zero W, 150
reserving IP address for Raspberry Pi on router, 149
RGB LED connected to, 129
robot, 145–160
rover
autonomous, 155–160
web-controlled, 150–155
running program, 25
saving hello.py program, 25
selecting Wi-Fi network, 11
setting up, 5–10
case, 7–9
display, 7
equipment
equipment to purchase, 5–9
power supply, 5–7
power supply, ethernet patch cable, 6
power supply, item, 6
power supply, kit, 6
power supply, micro-HDMI to HDMI, 6
power supply, micro-SD card, 6
power supply, TV/monitor with HDMI, 6
power supply, USB power supply, 6
keyboard and mouse, 7
micro-SD card, 7
setting up Raspberry Pi Zero W, 146–149
simulating dice, 29–32
software, 131–133, 138–140, 151–155
string theory, 39–41
strings, lists, and dictionaries, 39–62
summary of functions, 56
system, 9
temperature converter, 86–89
time zones, 138
tour of Raspberry Pi, 3–5
tuples, 54–56
TV/monitor with HDMI, 6
USB power supply, 6
variables, 26–28
verified peripherals, 20
web-controlled rover project, 150–155
Wi-Fi network, 11
Raspberry Pi 4, pixel desktop, 2
Raspberry Pi Zero W, setting up, 146–150
reading files, 73–75
red LED, Adafruit (299), 112
refactoring, defined, 105
remote GPO, 146
resistance, measuring, 124–126
resistors, 130
RGB common cathode LED, 130
RGB LED, connected to Raspberry Pi, 129
robot, 145–160
robot chassis, gear motors, 150
round(x, n), 57
rover
autonomous Raspberry Pi, 155–160
web-controlled, 150–155
S
Sach, Laura, 85
safety of Raspberry Pi, 113
saving contents of variable to file, 78
s.capitalize(), 58
s.center (width), 58
seconds, time in, mode of display, 140–141
self-adhesive Velcro pads, 150
serial console, 146
serial interface pins, 111
serial port, 146
setting up Raspberry Pi, 5–10
solderless breadboard, 112, 130, 136
SPI, 146
SSH (Secure SHell), 146–147
Putty, Windows, 147
Terminal, Linux/Unix-based computer, 147
string functions, 58
strings, 57–59
dictionaries, 39–62
list of, 41
sudo, 18–19
T
Terminal, Linux/Unix-based computer, 147
Terminal command line, 16
“time” library, 116
tour of Raspberry Pi, 3–5
tuples, 54–56
TXD and RXD (Transmit and Receive) pins, 111
type conversions, 60
U
ultrasonic rangefinder, 156
using modules, 64–65
V
variable called polite sentence, 45
variables, naming, 27
Velcro pads, 150
visitors to website, 144
VNC (Virtual Network Connection), 146–147
W
weatherstack, finding API key in, 81
web-controlled rover project, 150–155
website, 136
number of visitors, 144
window sliders, user interface, guizero, 131
wiring, checking before connecting electronics, 113
writing files, 76–77
Y
year, countdown of days remaining, 144
Z
Zero W, Raspberry Pi, setting up, 146–149
zone, time, setting, 138–139
3.14.70.203