image

YOU ARE WELL on your way to becoming an Arduino expert. You’ve tackled all sorts of things, from motors to potentiometers. You’ve even handled three potentiometers at the same time. But what about working with more than three of the same thing? One LED is good, three LEDs are better—but how about 24 LEDs?

As an experienced Arduino engineer, you might take a look at your Arduino board and question my counting abilities. There aren’t 24 output pins for LEDs on your board? You’re right! But you can harness the power of special chips called shift registers to extend the number of outputs, and that’s what you’re going to do in this adventure.

Code can start getting a little messy when you’re working with so many outputs, so I’ll show you some ways to keep your code tidy and easier to understand.

When you put it all together at the end of the adventure, you will make a carnival-style light-up sign that spells out your name (or any other word you choose).

What You Need

For the start of this adventure, you need a breadboard, LEDs and resistors. You’re going to be exploring different ways to light up a collection of LEDs in code. You then find out what a shift register is and how to use it. You need the following items; the electronic components are shown in Figure 4-1:

  • A computer
  • An Arduino Uno
  • A USB cable
  • 1 large breadboard or 2 small ones
  • 38 jumper wires
  • 16 LEDs
  • 16 220Ω resistors ...

Get Adventures in Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.