Introduction | p. 1 |
About This Book | p. 1 |
Foolish Assumptions | p. 2 |
Icons Used in This Book | p. 3 |
Beyond the Book | p. 3 |
Where to Go from Here | p. 4 |
Part 1 Setting Up Your Raspberry Pi | p. 5 |
Chapter 1 Introducing the Raspberry Pi | p. 7 |
Introducing the Raspberry Pi Range | p. 9 |
Raspberry Pi 4 Model B | p. 9 |
Raspberry Pi 400 | p. 11 |
Raspberry Pi 3 Model A+ | p. 12 |
Raspberry Pi Zero | p. 13 |
Older models | p. 14 |
Figuring Out What You Can Do with a Raspberry Pi | p. 17 |
Getting Your Hands on a Raspberry Pi | p. 18 |
Determining What Else You Need | p. 18 |
Essentials | p. 19 |
Optional extras | p. 22 |
Chapter 2 Downloading the Operating System | p. 25 |
Introducing Linux | p. 26 |
Imaging a microSD Card for Your Raspberry Pi | p. 27 |
Choosing the Right Operating System for Your Raspberry Pi | p. 29 |
Chapter 3 Connecting Your Raspberry Pi | p. 33 |
Connecting Your Raspberry Pi | p. 33 |
Setting Up Your Raspberry Pi | p. 36 |
Configuring Your Raspberry Pi in Raspberry Pi OS | p. 37 |
Changing Your Wi-Fi Settings | p. 40 |
Configuring Bluetooth Devices | p. 41 |
Connecting the Raspberry Pi Camera Module | p. 41 |
Connecting the camera on a Pi Zero | p. 42 |
Connecting the camera on other Raspberry Pi models | p. 43 |
Testing the Camera Module | p. 44 |
Connecting Using SSH | p. 46 |
Connecting Using VNC | p. 47 |
Part 2 Getting Started with Linux | p. 49 |
Chapter 4 Using the Desktop Environment | p. 51 |
Navigating the Raspberry Pi Desktop | p. 52 |
Using the Applications menu | p. 52 |
Running applications that are not on the menu | p. 55 |
Resizing and closing application windows | p. 55 |
Using the Task Manager | p. 56 |
Using File Manager | p. 57 |
Navigating File Manager | p. 58 |
Copying and moving files and folders | p. 61 |
Selecting multiple files and folders | p. 61 |
Creating new folders and blank files | p. 62 |
Deleting files and folders | p. 63 |
Sorting files | p. 63 |
Exploring your Raspberry Pi | p. 64 |
Browsing the Web with Chromium | p. 64 |
Searching within web pages | p. 65 |
Using tabbed browsing | p. 66 |
Adding and using bookmarks | p. 66 |
Protecting your privacy | p. 67 |
Sending and Receiving Email with Claws Mail | p. 68 |
Using the Image Viewer | p. 68 |
Using the Text Editor | p. 71 |
Configuring Printers | p. 72 |
Customizing the Desktop | p. 72 |
Playing the Games | p. 72 |
Finding and Installing New Applications | p. 75 |
Backing Up Your Data | p. 76 |
Logging Out and Shutting Down | p. 77 |
Chapter 5 Using the Linux Shell | p. 79 |
Understanding the Prompt | p. 80 |
Exploring Your Linux System | p. 81 |
Listing files and directories | p. 81 |
Changing directories | p. 81 |
Changing to the parent directory | p. 82 |
Understanding the directory tree | p. 82 |
Using relative and absolute paths | p. 85 |
Checking file types | p. 88 |
Investigating more advanced listing options | p. 89 |
Understanding the Long Listing Format and Permissions | p. 91 |
Slowing Down the Listing and Reading Files with the Less Command | p. 94 |
Speeding Up Entering Commands | p. 95 |
Using Redirection to Create Files | p. 96 |
Creating Directories | p. 98 |
Deleting Files | p. 99 |
Using Wildcards to Select Multiple Files | p. 101 |
Removing Directories | p. 103 |
Copying and Renaming Files | p. 104 |
Finding Files on Your Raspberry Pi | p. 106 |
Installing and Managing Software on Your Raspberry Pi | p. 106 |
Updating the cache | p. 107 |
Finding the package name | p. 107 |
Installing software | p. 108 |
Running software | p. 109 |
Upgrading the software | p. 109 |
Removing software and freeing up space | p. 110 |
Finding out what's installed | p. 111 |
Managing User Accounts on Your Raspberry Pi | p. 112 |
Learning More about Linux Commands | p. 114 |
Customizing the Shell with Your Own Linux Commands | p. 116 |
Shutting Down and Rebooting Your Raspberry Pi | p. 117 |
Part 3 Using the Raspberry Pi for both Work and Play | p. 119 |
Chapter 6 Being Productive with the Raspberry Pi | p. 121 |
Installing LibreOffice on Your Raspberry Pi | p. 122 |
Working with LibreOffice on the Raspberry Pi | p. 122 |
Saving your work | p. 123 |
Writing letters in LibreOffice Writer | p. 123 |
Managing your budget in LibreOffice Calc | p. 125 |
Creating presentations in LibreOffice Impress | p. 128 |
Creating a party invitation with LibreOffice Draw | p. 130 |
Chapter 7 Editing Photos on the Raspberry Pi with GIMP | p. 133 |
Working with GIMP | p. 134 |
Understanding the GIMP screen layout | p. 134 |
Resizing an image in GIMP | p. 136 |
Cropping your photo | p. 137 |
Rotating and flipping your photo | p. 138 |
Adjusting the colors | p. 139 |
Fixing imperfections | p. 139 |
Converting images between different formats | p. 141 |
Finding Out More about GIMP | p. 141 |
Chapter 8 Playing Audio and Video on the Raspberry Pi | p. 143 |
Setting Up Your Media Center | p. 143 |
Navigating the Media Center | p. 144 |
Adding Media | p. 145 |
Adding music | p. 146 |
Adding videos | p. 147 |
Adding pictures | p. 148 |
Streaming media | p. 148 |
Enjoying Your Media | p. 149 |
Playing music | p. 149 |
Playing videos | p. 150 |
Viewing photos | p. 150 |
Changing the Settings | p. 151 |
Using a Remote Control | p. 151 |
Turning Off Your Media Center | p. 152 |
Playing Music in the Desktop Environment | p. 152 |
Part 4 Programming the Raspberry Pi | p. 155 |
Chapter 9 Introducing Programming with Scratch | p. 157 |
Understanding What Programming Is | p. 158 |
Working with Scratch | p. 158 |
Understanding the Scratch screen layout | p. 159 |
Making your sprite move | p. 160 |
Creating scripts | p. 165 |
Changing your sprite's appearance | p. 165 |
Adding sounds and music | p. 170 |
Using the Wait block to slow down your sprite | p. 172 |
Using extensions in Scratch | p. 173 |
Saving your work | p. 175 |
Chapter 10 Programming an Arcade Game Using Scratch | p. 177 |
Starting a New Scratch Project and Deleting Sprites | p. 178 |
Changing the Backdrop | p. 178 |
Adding Sprites to Your Game | p. 179 |
Drawing Sprites in Scratch | p. 180 |
Naming Your Sprites | p. 184 |
Controlling When Scripts Run | p. 184 |
Using the green flag to start scripts | p. 185 |
Using the Forever Control block | p. 186 |
Enabling keyboard control of a sprite | p. 186 |
Enabling a sprite to control another sprite | p. 188 |
Using Random Numbers | p. 190 |
Detecting When a Sprite Hits Another Sprite | p. 191 |
Introducing Variables | p. 192 |
Making Sprites Move Automatically | p. 194 |
Fixing the Final Bug | p. 195 |
Adding Scripts to the Stage | p. 198 |
Duplicating Sprites | p. 198 |
Playing Your Game | p. 198 |
Adapting the Game's Difficulty | p. 199 |
Taking It Further with Scratch | p. 199 |
Chapter 11 Writing Programs in Python | p. 201 |
Working with Python | p. 202 |
Entering your first Python commands | p. 202 |
Using the shell to calculate sums | p. 204 |
Creating the Times Tables Program | p. 206 |
Creating and running your first Python program | p. 206 |
Using variables | p. 208 |
Accepting user input | p. 209 |
Printing words, variables, and numbers together | p. 210 |
Using for loops to repeat | p. 211 |
Creating the Chatbot Program | p. 215 |
Introducing lists | p. 216 |
Using lists to make a random chat program | p. 218 |
Adding a while loop | p. 221 |
Using a loop to force a reply from the user | p. 222 |
Using dictionaries | p. 223 |
Creating your own functions | p. 225 |
Creating the dictionary look-up function | p. 227 |
Creating the main conversation loop | p. 229 |
Final thoughts on Chatbot | p. 230 |
The final Chatbot program | p. 231 |
Chapter 12 Creating a Game with Python and Pygame Zero | p. 233 |
Collecting Your Sounds and Images | p. 234 |
Setting Up Your Folders | p. 235 |
Creating and Running Your First Program | p. 235 |
Detecting mouse clicks | p. 238 |
Animating your actors | p. 239 |
Using random numbers | p. 241 |
Adding more clouds | p. 242 |
Making the clouds regenerate | p. 244 |
Enabling multiple clouds to be clicked | p. 245 |
Adding the timer | p. 246 |
Adjusting the game difficulty | p. 247 |
The final game listing | p. 247 |
Exploring Pygame Zero Further | p. 249 |
Chapter 13 Programming Minecraft with Python | p. 251 |
Playing Minecraft | p. 252 |
Moving around | p. 253 |
Making and breaking things | p. 253 |
Preparing for Python | p. 254 |
Using the Minecraft Module | p. 255 |
Understanding coordinates in Minecraft | p. 256 |
Repositioning the player | p. 256 |
Adding blocks | p. 257 |
Stopping the player from changing the world | p. 259 |
Setting the maze parameters | p. 259 |
Laying the foundations | p. 261 |
Placing the maze walls | p. 262 |
Understanding the maze algorithm | p. 263 |
Setting up the variables and lists | p. 264 |
Creating the functions | p. 265 |
Creating the main loop | p. 266 |
Adding a ceiling | p. 268 |
Positioning the player | p. 269 |
The final code | p. 269 |
Adapting the Program | p. 273 |
Chapter 14 Making Music with Sonic Pi | p. 275 |
Understanding the Sonic Pi Screen Layout | p. 276 |
Playing Your First Notes | p. 277 |
Using Note and Chord Names | p. 279 |
Playing Timed Patterns | p. 280 |
Composing Random Tunes Using Shuffle | p. 281 |
Changing the Random Number Seed | p. 282 |
Using List Names in Your Programs | p. 282 |
Playing Random Notes | p. 282 |
Experimenting with Live Loops | p. 283 |
Using Samples | p. 285 |
Adding Special Effects | p. 286 |
Synchronizing with Your Drumbeat | p. 287 |
Bringing It All Together | p. 287 |
Next Steps with Sonic Pi | p. 289 |
Part 5 Exploring Electronics with the Raspberry Pi | p. 291 |
Chapter 15 Understanding Circuits | p. 293 |
Discovering What a Circuit Is | p. 294 |
Understanding the nature of electricity | p. 294 |
Determining how a component needs to be treated | p. 303 |
Getting Familiar with the GPIO | p. 304 |
Putting the general purpose in GPIO | p. 306 |
Understanding what GPlOs do | p. 306 |
Putting an output pin to practical use | p. 307 |
Using GPIOs as inputs | p. 309 |
Learning which end is hot: Getting to grips with a soldering iron | p. 311 |
Making a soldered joint | p. 313 |
Looking at Ready-Made Add-On Boards | p. 314 |
The Sense HAT | p. 315 |
The Trill sensors | p. 315 |
The LED SHIM | p. 316 |
Other boards | p. 317 |
Chapter 14 Taking Control of Your Pi's Circuitry | p. 319 |
Accessing Raspberry Pi's GPIO Pins | p. 319 |
Soldering the GPIO pins onto Pi Zero or Pi ZeroW | p. 321 |
Getting at all the pins with one connector | p. 322 |
Connecting things together | p. 324 |
Your First Circuit | p. 325 |
Bringing your LED to life | p. 326 |
Using Scratch 3.0 | p. 326 |
Control the flashing speed with an input | p. 328 |
Using Python | p. 330 |
Using GPIO ZERO | p. 332 |
Starting Out with a Dice Display | p. 336 |
A dice display | p. 336 |
The project | p. 339 |
The numbers | p. 339 |
The display | p. 340 |
Taking it further | p. 345 |
Pedestrian Crossing | p. 346 |
The Pedestrian Crossing hardware | p. 349 |
The Pedestrian Crossing software | p. 350 |
Taking it further | p. 354 |
Chapter 17 Lots of Multicolored LEDs | p. 357 |
Making Colors | p. 359 |
Using diffusers | p. 359 |
Making more colors | p. 360 |
The Way Forward | p. 362 |
Bit-banging the APA102C protocol | p. 365 |
Creating a class | p. 367 |
Rainbow Invaders | p. 371 |
Keepy Uppy | p. 376 |
LEDs Galore | p. 379 |
Current limits | p. 379 |
Signals and memory | p. 380 |
Display update | p. 381 |
Getting more LEDs | p. 381 |
Chapter 18 Old McDonald's Farm and Other RFID Adventures | p. 391 |
How RFID Work | p. 392 |
A MIFARE card's structure | p. 395 |
A simple RFID jukebox | p. 398 |
A better RFID jukebox | p. 399 |
Taking it further | p. 403 |
Dressing Up a Paper Doll | p. 403 |
Runway time | p. 408 |
Old McDonald's Farm | p. 412 |
Making sound samples | p. 412 |
Making the graphics | p. 415 |
Part 6 The Part of Tens | p. 425 |
Chapter 19 Ten Great Software Packages for the Raspberry Pi | p. 427 |
Penguins Puzzle | p. 428 |
FocusWriter | p. 429 |
Mathematica | p. 429 |
Fraqtive | p. 431 |
Tux Paint | p. 432 |
Grisbi | p. 433 |
Beneath a Steel Sky | p. 433 |
Brain Party | p. 434 |
Pure Data | p. 435 |
Inkscape | p. 437 |
Chapter 20 Ten Inspiring Projects for the Raspberry Pi | p. 439 |
One-Button Audiobook Player | p. 439 |
Heartbeat Monitor | p. 440 |
Smart Fridge | p. 440 |
The Next Verse | p. 441 |
Electric Skateboard | p. 441 |
T-Shirt Cannon | p. 442 |
Magic Mirror | p. 442 |
Pi in the Sky | p. 443 |
Raspberry Turk | p. 444 |
Sound Fighter | p. 445 |
Chapter 21 Ten Great Add-Ons for the Raspberry Pi | p. 447 |
Picade | p. 448 |
CamJam EduKit 3 | p. 449 |
Piano HAT | p. 450 |
Rainbow HAT | p. 451 |
Display-O-Tron HAT | p. 451 |
Flick | p. 451 |
Unicorn HAT HD | p. 452 |
Inky pHAT | p. 452 |
Pirate Audio | p. 452 |
Witty Pi | p. 453 |
Appendix: Troubleshooting and Configuring the Raspberry Pi | p. 455 |
Index | p. 467 |