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, ...

Get Arduino Development Cookbook 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.