This instructable will attempt to explain, in simple terms, what a shift register is, and how you can use it with the Raspberry Pi to expand the GPIO port by running eight outputs with just four GPIO ports.
To start with, what is a shift register? Wikipedia has a technical definition of shift registers
, but in a nut shell, shift registers let you take serial input (one bit after the other), and output it in parallel.
Let's say, for example, you wanted to output six digital bits from your Raspberry Pi to drive a display based on the HD44780, like this one
, but your project had to give up almost all the GPIO to other things, and all you have left is four pins. You can send those six bits one after the other to the shift register using those four pins, which will then appear to the display as six parallel outputs.
For this project, which is a first step towards the above situation, I'm going to run LEDs off each of the eight outputs, just as a proof of concept. The attached video shows the end result of this process. Just a bunch of flashing lights for now, but stay tuned. This is really the second in a series of instructables leading up to my Voiceberry Pi (see the first one here