Book Image

Arduino Development Cookbook

By : Cornel M Amariei
Book Image

Arduino Development Cookbook

By: Cornel M Amariei

Overview of this book

Table of Contents (16 chapters)
Arduino Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

More outputs – shift registers


Arduino has a limited number of digital pins. Sometimes, we want to build projects that require more pins than we have available on our boards. This is actually a common problem in electronics, which led to the invention of the shift register.

A shift register transforms serial data to parallel output. Basically, we tell the register what value to set for each output pin it has. If, for example, it has eight output pins, we will first say the value of the 8th pin and then the 7th pin until we get to the first one. The advantage is that we are using around three Arduino pins to get eight or even sixteen, which is very convenient.

There are a lot of shift registers available and they mostly work the same. For simplicity, we will only address the commonly available 74HC595 to control eight LEDs with just three pins.

Getting ready

For this recipe, we will require the following ingredients:

  • An Arduino board connected to a computer via USB

  • A 74HC595 shift register

  • A breadboard...