CHAPTER 3
Building Binary Dice
Things will really start to get interesting now that you’ve learned the basics
of Arduino development. You now have the skills to create your first complex,
stand-alone projects. After you’ve worked through this chapter, you’ll know
how to work with LEDs, buttons, breadboards, and resistors. Combining
these parts with an Arduino gives you nearly endless opportunities for new
and cool projects.
Our first project will be creating an electronic die. While regular dice display
their results using one to six dots, ours will use LEDs instead. For our first
experiments, a single LED was sufficient, but for the dice we need more than
one. You need to connect several external LEDs to the Arduino. Because you
cannot attach them all directly to the Arduino, you’ll learn how to work with
breadboards. Also, you need a button that rolls the dice, so you’ll learn how
to work with pushbuttons, too. To connect pushbuttons and LEDs to the
Arduino, you need another important electronic part: the resistor. At the end
of the chapter, you’ll have many new tools in your toolbox.
What You Need
1. A half-size breadboard
2. Three LEDs (for the exercises you’ll need additional LEDs)
3. Two 10kΩ resistors (see Current, Voltage, and Resistance, on page 239, to
learn more about resistors)
4. Three 1kΩ resistors
5. Two pushbuttons
6. Some wires of different lengths
7. An Arduino board, such as the Uno, Duemilanove, or Diecimila
8. A USB cable to connect the Arduino to your computer
report erratum • discuss
www.it-ebooks.info