Table of Contents
Introduction 1 CHAPTER 1
Computer-Controlled Slot Car Racing 3
Obtaining a Slot Car Racer 4
Hacking Your Slot Car Racer 4
Testing Your Slot Car Racer Hack 6
Getting the Player Input 7
Making the Joystick Buttons 7
Boxing It Up 12
Joystick Testing 16
The Software 18
The Game 20
Over to You 27
CHAPTER 2
Facebook-Enabled Roto-Sketch 29
The Concept 30
Rotary Encoder Types 30
The Encoder Output 31
Posting to Facebook 40
Using Flickr 40
The Final Roto-Sketch Program 44
Creating a Symmetrical Pattern 50
Over to You 56
CHAPTER 3
The Pendulum Pi, a Harmonograph 59
The Concept 61
The Hall Effect 61
Enter the Arduino 63
Putting It Together 64
Smooth Swinging 69
Electronics 71
Programming the Arduino 76
The Final Arduino Code 81
Programming the Pi 89
Using the Pendulum Pi 94
Over to You 96
APPENDIX A
Getting Your Raspberry Pi Up and Running 97
The Operating System 98
Getting the OS on an SD Card 99
Premade Cards 99
Creating Your Own SD Card 100
Connecting Your Raspberry Pi 104
Connecting a Display 106
Connecting via HDMI 107
Connecting via DVI 107
Connecting via VGA 109
Connecting via Composite 109
Connecting to a Network 110
Booting the Operating System 111
Powering Up! 113
The Boot Process 114
Starting the Graphical Desktop 114
Starting a Terminal under X 115
Troubleshooting 115
Common Problems 115
No Lights Come On 115
Only the Red Light Comes On 116
No Monitor Output 116
Intermittent Problems 116
Power Problems 116
If You Need More Help 117
Let the Fun Begin! 118
APPENDIX B
Introductory Software Project: The Insult Generator 119
Running Your First Python Program 120
Saving Your Program 123
Generating an Insult 126
Variables 126
Strings 127
Lists 127
Functions 128
Insult Your Friends by Name! 129
Conditional Behaviour 131
Create a Stream of Insults! 131
Making Your Own Functions 131
Creating Loops 132
for Loop 133
while Statement 134
Putting It All Together 135