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.