Getting Started with Raspberry Pi: Electronic Projects with Python, Scratch, and Linux

Getting Started with Raspberry Pi: Electronic Projects with Python, Scratch, and Linux

by Matt Richardson, Shawn Wallace


$17.99 $19.99 Save 10% Current price is $17.99, Original price is $19.99. You Save 10%.
Choose Expedited Shipping at checkout for guaranteed delivery by Thursday, October 24


What can you do with the Raspberry Pi, the affordable computer the size of a credit card? All sorts of things! If you're learning how to program—or looking to build new electronic projects, this hands-on guide will show you just how valuable this flexible little platform can be.

Updated to include coverage of the Raspberry Pi Model B+, Getting Started with Raspberry Pi takes you step-by-step through many fun and educational possibilities. Take advantage of several preloaded programming languages. Use the Raspberry Pi with Arduino. Create Internet-connected projects. Play with multimedia. With Raspberry Pi, you can do all of this and more.

In Getting Started with Raspberry Pi , you’ll:

  • Get acquainted with hardware features on the Pi's board
  • Learn enough Linux to move around the operating system
  • Start programming in Python and Scratch
  • Draw graphics, play sounds, and handle mouse events with Pygame
  • Use the Pi's input and output pins to do some hardware hacking
  • Discover how Arduino and the Raspberry Pi can work together
  • Create your own Pi-based web server with Python
  • Work with the Raspberry Pi Camera Module and USB webcams

Product Details

ISBN-13: 9781457186127
Publisher: Maker Media, Inc
Publication date: 11/08/2014
Pages: 200
Sales rank: 1,143,196
Product dimensions: 5.40(w) x 8.40(h) x 0.60(d)
Age Range: 12 - 18 Years

About the Author

Matt Richardson is a San Francisco-based Product Evangelist for Raspberry Pi, and is responsible for outreach within the United States. He’s a graduate of New York University’s Interactive Telecommunications Program. Highlights from his work include the Descriptive Camera (a camera which outputs a text description instead of a photo) and The Enough Already (a DIY celebrity-silencing device). Matt’s work has been featured at The Nevada Museum of Art, The Rome International Photography Festival, Milan Design Week and has garnered attention from The New York Times, Wired, and New York Magazine.

Shawn Wallace is the Director of the AS220 Industries, part of the AS220 community arts center in Providence RI. There he shepherds the Providence Fab Lab, Printshop and Media arts programming, designs open hardware kits for Modern Device and runs the local node of the Fab Academy. He's member of the Fluxama artist collective responsible for new iOS musical instruments such as Noisemusick and Doctor Om. Shawn was formerly an editor at O'Reilly and Maker Media and is a cofounder of the SMT Computing Society.

Table of Contents

Preface vii

1 Getting Up and Running 1

A Tour of the Boards 2

The Proper Peripherals 7

The Case 10

Choose Your Distribution 12

Flash the SD Card 12

For Advanced Users: Create Your Own Disk Image 13

Booting Up 14

Configuring Your Pi 16

Shutting Down 17

Running Headless 18

Troubleshooting 18

Going Further 19

2 Getting Around Linux on the Raspberry Pi 21

Using the Command Line 25

Files and the Filesystem 25

More Linux Commands 28

Processes 31

Sudo and Permissions 31

The Network 33

/etc 34

Setting the Date and Time 34

Installing New Software 34

Sound in Linux 35

Upgrading Your Firmware 36

Going Further 36

3 Specialized Distributions 39

Distributions for Home Theater 40

Distributions for Music 42

Hardware Hacking with Occidentalis 41

Retrocomputing and Retrogaming 42

Other Useful Distributions 42

Going Further 42

4 Python on the Pi 43

Hello, Python 44

A Bit More Python 46

Objects and Modules 48

Even More Modules 51

Launching Other Programs from Python 53

Troubleshooting Errors 54

Going Further 54

5 Pygame for Animation and Multimedia 57

Hello, Pygame 57

Pygame Surfaces 59

Drawing on Surfaces 60

Handling Events and Inputs 61

Sprites 63

Playing Sound 65

Playing Video 67

Going Further 68

6 Scratch on the Pi 69

Hello, Scratch 69

The Stage 74

Two More Things to Know about Sprites 74

A Bigger Example: Astral Trespassers 76

Scratch and the Real World 82

Sharing Your Programs 83

Going Further 84

7 Arduino and the Pi 85

Installing Arduino in Raspbian 86

Finding the Serial Port 87

Talking in Serial 88

Using Firmata 91

Going Further 92

8 Basic Input and Output 93

Using Inputs and Outputs 95

Digital Output: Lighting Up an LED 96

Digital Input: Reading a Button 100

Project: Cron Lamp Timer 103

Scripting Commands 103

Connecting a Lamp 104

Scheduling Commands with cron 106

Going Further 107

9 Programming Inputs and Outputs with Python 109

Installing and Testing GPIO in Python 109

Blinking an LED 112

Reading a Button 133

Project: Simple Soundboard 115

Going Further 119

10 Analog Input and Output 121

Output: Converting Digital to Analog 122

Test Driving PWM 123

Taking PWM Further 125

Input: Converting Analog to Digital 125

Variable Resistors 130

Going Further 133

11 Working with Cameras 135

Connecting and Testing the Camera Module 137

Project: Making a GIF 139

Capturing Video 140

Testing USB Webcams 140

Installing and Testing SimpleCV 141

Additional Steps for the Raspberry Pi Camera Module 142

Displaying an Image 143

Modifying an Image 144

Accessing the Webcam 147

Face Detection 148

Project: Raspberry Pi Photobooth 149

Going Further 152

12 Python and the Internet 153

Download Data from a Web Server 153

Fetching the Weather Forecast 155

Serving Pi (Be a Web Server) 159

Flask Basics 159

Connecting the Web to the Real World 162

Project: WebLamp 164

Going Further 169

A Writing an SD Card Image 171

Index 175

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews