Chapter 2. Digital input and output

 

This chapter covers

  • Blinking more than one LED
  • Using a push button to control a sequence of blinking LEDs
  • Building a project step by step
  • Learning about interrupts
  • Building a reactometer

Now that you have a sense of what an Arduino can do and have completed your first test run, it’s time to delve deeper. You’re going to build on what you learned in chapter 1 and build your first complete project, a reactometer that uses LEDs, a push button, and a timer to record reaction times.

Let’s get started.

2.1. Getting started

To complete your reactometer, you need a handful of components:

  • A breadboard on which to assemble the project
  • A selection of jumpers to connect components together
  • Six red LEDs; you can use other colors if you want
  • One green LED
  • One momentary-contact push button
  • Seven resistors, each around 180 ohms or slightly greater in value
  • One 10k ohm resistor

You can see these components in figure 2.1.

Figure 2.1. The components required to complete this tutorial

Next, you’ll assemble the circuit on a breadboard.

2.1.1. Using a breadboard

Breadboards are great for assembling circuits, particularly during the development phase of a project, because they make it easy to move components around or add new ones.

2.2. Gaining control

2.3. Reaction tester

2.4. Reactometer: Who really has the fastest reaction time?

2.5. Summary

sitemap