simple explanation of shift register use.

I had to try and explain what a serial in parallel out shift register does, and came up with this, which might be of some use to newcomers.

A postman ( mailman ) has to deliver 10 parcels to 10 houses in a row, he can only carry one at a time, so to save a lot of walking, he comes up with the idea of parking at the end house and tooting his horn ( taking the latch pin low ) to call the people out of their houses to their front gardens.

He then gives the parcel for the furthest house to the lady at the first house, and asks her ( taking the shift register clock high and low again ) to pass it to the next lady.

He then gives her the second parcel and shouts to everyone to pass them on ( pulsing the shift clock again )

When all the parcels have been passed out , he tells them to take them indoors and open them ( by taking the latch pin high again )

In practice this save a lot of wiring ( walking ) and a great many devices can be connected to shift data to the right device, such as LED displays which would need thousands of individual wires to light the correct patterns.

Would be a really nice analogy if there were 10 input bits/10 output lines. But, there probably aren't.

Not bad. And an example of using arduino output pins directly would be sending 10 postmen out each with one package to deliver at nearly the same time, much faster but uses up resources (mailpersons/trucks = pins used).

Okay PaulS, how about 16 bits then?

You could with a bit of imagination having the people swapping parcels with ones to be posted, going the other way in a SPI fashion?

Yes, that'd be a shift-in register. Parallel load, serial shift in.
74AC299 is nice chip, can do both, and shift left or right.

I was thinking of the MISO MOSI action of swapping parcels.

Ok, that's the built-in hardware version of shiftout () or shiftin().
Same concept of passing out one at a time, or collected many at a time but turned in 1 by 1.

Yes, its probably getting away from my original " Harry Potter does Arduino" explanation for absolute beginners :slight_smile: