Part II — Eleven Arduino Projects
3. Building Binary Dice . . . . . . . . . . . 39
What You Need 39
Working with Breadboards 40
Using an LED on a Breadboard 41
First Version of a Binary Die 45
Working with Buttons 48
Adding Your Own Button 53
Building a Dice Game 55
What If It Doesn’t Work? 59
Exercises 60
4. Building a Morse Code Generator Library . . . . . 61
What You Need 61
Learning the Basics of Morse Code 62
Building a Morse Code Generator 62
Fleshing Out the Morse Code Generator’s Interface 64
Outputting Morse Code Symbols 65
Installing and Using the Telegraph Class 67
Publishing Your Own Library 71
What If It Doesn’t Work? 73
Exercises 73
5. Sensing the World Around Us . . . . . . . . 77
What You Need 78
Measuring Distances with an Ultrasonic Sensor 78
Increasing Precision Using Floating-Point Numbers 84
Increasing Precision Using a Temperature Sensor 86
Creating Your Own Dashboard 92
What If It Doesn’t Work? 97
Exercises 98
6. Building a Motion-Sensing Game Controller . . . . . 99
What You Need 100
Wiring Up the Accelerometer 100
Bringing Your Accelerometer to Life 102
Finding and Polishing Edge Values 103
Building Your Own Game Controller 106
More Projects 109
Contents • vi
www.it-ebooks.info