Skip to Content
Adventures in Arduino
book

Adventures in Arduino

by Becky Stewart
May 2015
Beginner content levelBeginner
320 pages
7h 20m
English
Wiley
Content preview from Adventures in Arduino
image

THERE ARE LOTS of ways to make code control things in the real world. You have already controlled movement with motors and controlled light with LEDs. In this adventure you’re going to create sound!

In Adventures 3 and 4, you discover some new ways to make your code more efficient when you need to repeat the instructions more than once. The for loop is a great tool for repeating something a set number of times. When you combine a for loop with special lists in code—called arrays—you end up with a powerful coding tool.

After learning how to harness the power of arrays and figuring out how to get your Arduino to sing to you, you’re going to put your new skills into practice by building an augmented wind chime that plays both acoustic and electronic sounds.

What You Need

You need a few things for the first part of this chapter (the electronic components are shown in Figure 5-1):

  • A computer
  • An Arduino Uno
  • A USB cable
  • A breadboard
  • 7 jumper wires
  • 6 LEDs
  • 6 220Ω resistors
  • A piezo
image

Figure 5-1 The electronic components you need for the first part of this adventure

Making a List

Variables are useful ways of keeping track of information like the numbers of the pins on your Arduino Uno. Creating a variable to store the number of the pin to which a particular LED is connected makes your ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Arduino Playground, 1st Edition

Arduino Playground, 1st Edition

Warren Andrews
Pro Arduino

Pro Arduino

Rick Anderson, Dan Cervo

Publisher Resources

ISBN: 9781118948460Purchase book