Preface |
|
xiii | |
Acknowledgments |
|
xv | |
About this book |
|
xvii | |
|
|
1 | (64) |
|
|
3 | (30) |
|
What is the Raspberry Pi? |
|
|
4 | (1) |
|
Exploring your Raspberry Pi's parts: hardware |
|
|
4 | (15) |
|
Giving your Pi a cozy home: Pi cases |
|
|
6 | (1) |
|
The brain of your Pi: system on a chip |
|
|
7 | (1) |
|
Connecting a keyboard and mouse: USB ports |
|
|
8 | (2) |
|
Storing memories: your Pi gets a memory card |
|
|
10 | (3) |
|
Connecting a TV or monitor: HDMI port |
|
|
13 | (4) |
|
Other ports and connections |
|
|
17 | (1) |
|
Powering your Pi: microUSB power port |
|
|
17 | (1) |
|
It's alive! Plugging in the Pi |
|
|
18 | (1) |
|
Getting your Pi running: software |
|
|
19 | (7) |
|
Installing the Raspbian operating system |
|
|
19 | (2) |
|
Configuring the operating system: making it yours |
|
|
21 | (3) |
|
Saving your configuration and rebooting |
|
|
24 | (2) |
|
Getting around: learning Raspbian |
|
|
26 | (3) |
|
Finding and opening applications on your Raspberry Pi |
|
|
26 | (1) |
|
|
26 | (2) |
|
|
28 | (1) |
|
Fruit Picker Extra: shopping at the Pi Store |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
31 | (2) |
|
|
33 | (32) |
|
|
33 | (2) |
|
Discovering Python's mathematical operators |
|
|
35 | (6) |
|
|
35 | (2) |
|
|
37 | (1) |
|
Figuring out whole numbers and remainders |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
39 | (2) |
|
Storing information using variables |
|
|
41 | (9) |
|
Creating variables and assigning values |
|
|
42 | (1) |
|
Displaying variable values |
|
|
42 | (3) |
|
Storing strings in variables |
|
|
45 | (1) |
|
Changing the value of variables |
|
|
46 | (4) |
|
Displaying text on a screen |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
52 | (5) |
|
Writing Python programs with IDLE |
|
|
53 | (1) |
|
|
54 | (2) |
|
|
56 | (1) |
|
Python interpreting the program |
|
|
57 | (1) |
|
Fruit Picker Extra: creating documents |
|
|
57 | (3) |
|
Writing silly things and saving them |
|
|
57 | (3) |
|
|
60 | (2) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (3) |
|
Part 2 Playing with Python |
|
|
65 | (84) |
|
3 Silly Sentence Generator 3000: creating interactive programs |
|
|
67 | (24) |
|
Creating a welcome message |
|
|
68 | (5) |
|
|
69 | (2) |
|
|
71 | (2) |
|
Adding notes in your code |
|
|
73 | (2) |
|
Using hashtags for comments |
|
|
73 | (2) |
|
Getting and storing information |
|
|
75 | (2) |
|
|
77 | (6) |
|
Using more than one input |
|
|
79 | (1) |
|
|
80 | (1) |
|
|
81 | (2) |
|
Completing the program: displaying the silly sentence |
|
|
83 | (2) |
|
Fruit Picker Extra: Minecraft Pi |
|
|
85 | (3) |
|
|
85 | (1) |
|
|
86 | (2) |
|
Python programming interface to Minecraft Pi |
|
|
88 | (1) |
|
|
88 | (2) |
|
Knight's Tale Creator 3000 |
|
|
88 | (1) |
|
|
89 | (1) |
|
|
90 | (1) |
|
4 Norwegian Blue parrot game: adding logic to programs |
|
|
91 | (30) |
|
Displaying the game introduction |
|
|
92 | (9) |
|
Creating the game welcome message and instructions |
|
|
94 | (7) |
|
Collecting input from the player |
|
|
101 | (4) |
|
Using if statements to respond to users in different ways |
|
|
105 | (5) |
|
|
108 | (2) |
|
Using while loops to repeat things |
|
|
110 | (5) |
|
A closer look at while loops |
|
|
112 | (1) |
|
Breaking out of a while loop |
|
|
113 | (1) |
|
|
114 | (1) |
|
Using Python code libraries to generate random numbers |
|
|
115 | (3) |
|
Fruit Picker Extra: Scratch |
|
|
118 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
121 | (28) |
|
Project introduction: Raspi's Cave Adventure |
|
|
122 | (2) |
|
|
124 | (1) |
|
|
124 | (1) |
|
Hey wait, you need a plan (flow diagrams) |
|
|
124 | (2) |
|
Which way should Raspi go? (checking input) |
|
|
126 | (7) |
|
Handling unexpected input |
|
|
127 | (4) |
|
Turning flow diagrams into code |
|
|
131 | (2) |
|
Simplify! Making your own functions |
|
|
133 | (9) |
|
|
138 | (1) |
|
|
139 | (2) |
|
|
141 | (1) |
|
Fruit Picker Extra: playing video |
|
|
142 | (3) |
|
Live streaming: exploring from your Pi |
|
|
143 | (2) |
|
|
145 | (2) |
|
Introducing dramatic pauses |
|
|
145 | (1) |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
147 | (2) |
|
Part 3 Pi and Python projects |
|
|
149 | (90) |
|
|
151 | (25) |
|
Setting up your Pi for physical computing |
|
|
153 | (8) |
|
|
153 | (2) |
|
Breaking out the GPIO pins to a breadboard |
|
|
155 | (3) |
|
|
158 | (3) |
|
|
161 | (5) |
|
Step 1 Connect the jumper from GPIO pin 21 |
|
|
163 | (1) |
|
|
164 | (1) |
|
Step 3 Connect a resistor |
|
|
164 | (2) |
|
Software: blinkLED program |
|
|
166 | (5) |
|
|
168 | (1) |
|
|
169 | (2) |
|
|
171 | (2) |
|
|
171 | (2) |
|
Multiple LEDs: program it! |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
176 | (28) |
|
|
178 | (1) |
|
Hardware: building the circuit |
|
|
179 | (9) |
|
Numbers, numbers, numbers! |
|
|
179 | (1) |
|
|
180 | (1) |
|
|
180 | (8) |
|
Software: LEDGuessingGame program |
|
|
188 | (13) |
|
Setting up the GPIO pins for the RGB LED |
|
|
190 | (5) |
|
|
195 | (2) |
|
Guessing Game Loop and logic |
|
|
197 | (1) |
|
Adding the Play Again Loop and logic |
|
|
198 | (2) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
202 | (1) |
|
|
202 | (2) |
|
|
204 | (35) |
|
|
205 | (2) |
|
Setting up your Pi to play sounds |
|
|
207 | (3) |
|
|
208 | (1) |
|
|
209 | (1) |
|
Hardware: building the circuit |
|
|
210 | (8) |
|
|
210 | (1) |
|
|
211 | (6) |
|
|
217 | (1) |
|
Software: the DJ Raspi program |
|
|
218 | (17) |
|
Setting up the Pi: initializing the buttons |
|
|
220 | (1) |
|
|
221 | (4) |
|
Getting a value of an item stored in a list |
|
|
225 | (1) |
|
Getting the length of a list |
|
|
226 | (1) |
|
Building a list of sound files with the os library |
|
|
227 | (1) |
|
Playing a sound when a button is pressed |
|
|
228 | (3) |
|
|
231 | (3) |
|
Testing: your first gig as DJ Raspi |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (1) |
|
Double button press surprise |
|
|
236 | (1) |
|
|
236 | (1) |
|
|
237 | (1) |
|
|
237 | (2) |
Appendix A Raspberry Pi troubleshooting |
|
239 | (6) |
Appendix B Raspberry Pi ports and legacy boards |
|
245 | (16) |
Appendix C Solutions to chapter challenges |
|
261 | (18) |
Appendix D Raspberry Pi projects |
|
279 | (6) |
Index |
|
285 | |