Hello Raspberry Pi!: Python programming for kids and other beginners
Format: PDF / Kindle (mobi) / ePub
A fun and imaginative way for kids and other beginners to take their first steps programming on a Raspberry Pi.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the Technology
The Raspberry Pi is a small, low-cost computer invented to encourage experimentation. The Pi is a snap to set up, and using the free Python programming language, you can learn to create video games, control robots, and maybe even write programs to do your math homework!
About the Book
Hello Raspberry Pi! is a fun way for kids to take their first steps programming on a Raspberry Pi. First, you discover how to set up and navigate the Pi. Next, begin Python programming by learning basic concepts with engaging challenges and games. This book gives you an introduction to computer programming as you gain the confidence to explore, learn, and create on your own. The last part of the book introduces you to the world of computer control of physical objects, where you create interactive projects with lights, buttons, and sounds.
About the Reader
To use this book, you'll need a Raspberry Pi starter kit, keyboard, mouse, and monitor. No programming experience needed.
Table of Contents
- Meet Raspberry Pi
- Exploring Python
- Silly Sentence Generator 3000: creating interactive programs
- Norwegian Blue parrot game: adding logic to programs
- Raspi's Cave Adventure
- Blinky Pi
- Light Up Guessing Game
- DJ Raspi
PART 1 GETTING STARTED 1
PART 2 PLAYING WITH PYTHON
PART 3 PI AND PYTHON PROJECTS
- Raspberry Pi troubleshooting
- Raspberry Pi ports and legacy boards
- Solutions to chapter challenges
- Raspberry Pi projects
print function in the loop and use it to print out the value of a variable such as the counter each time through the loop. In this example, you might add this line in your loop: print(number_of_guesses) This prints out the value stored in the number_of_guesses variable each time the code goes through the loop. You can see whether the counter is incrementing as you expect and whether it’s starting with the right number. Using Python code libraries to generate random numbers You program
look like; gather the parts, and let’s get started! Figure 6.1. The Blinky Pi project requires parts that are commonly found in Raspberry Pi starter kits or that can be purchased online. Setting up your Pi for physical computing Your Pi is unique compared to most computers because of its input and output pins, called GPIO pins. Let’s learn how to work with those pins. Definition GPIO stands for general purpose input and output. These are the pins on your Raspberry Pi that allow it to
Raspberry Pi is no different. Do the right thing and protect your Pi by putting it in a case (see figure 1.2). If your Pi didn’t come with a case, you have a lot of options. You can buy one or make your own. My favorite approach is to make my own case from wood, cardboard, a plastic container, or even LEGOs. The key is making sure your Pi is protected from accidental drops and, ideally, spills. But before you close up your Pi in a case, let’s take a closer look at some of its features. Figure
loops breaking out of overview troubleshooting lower method M math module mathematical operators adding and subtracting exponents multiplying and dividing order of operations remainders square roots memory. See also SD cards. mencoder program methods, functions vs., 2nd microSD cards Minecraft Pi miniSD cards MIT (Massachusetts Institute of Technology) monitors component video input connecting to HDMI port identifying ports RCA port VGA port monitors, checking connection to mouse
inserting card in slot NOOBS on overview portability of reformatting replacing cards SDFormatter software setmode function Silly Sentence Generator 3000, 2nd, 3rd commenting code creating program debugging input function joining strings building sentence overview using multiple inputs Minecraft Pi overview printing to screen saving program SoC (system on a chip) SparkFun website square brackets square roots streaming video string literals, 2nd string methods strings joining building