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.
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.
Next, you’ll assemble the circuit on 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.