Shift register real example?

Hi to all friends here.
i want to try to experiment with shift register using the classic 74HC595 ic to add extra Digital output pins ( and later 74HC165 ic for input).

i have seen a lot of examples through internet but all have the same approach.. using "for" loop to make some leds to go on and off or make the famous kit (knight rider) led strip

As the "Shift Register" was and still is a pain in the @#$ for me to understand it clearly , i would like to see a example in real situation.. in order to make me understand it

what if we want to change the output state of the pin 3 only of the 74HC595 ?
should we know the state of all other pins in order to change the pin 3 or we can just send command to change only this pin without take in consideration of other pins state?

That is why i would like to see a sample code of a real project in order to understand the use of the shift register

thanks in advance

Study this discussion:


You cannot just update one bit, you have to change the bit in your code and send all bits to the shift register.

Each time a bit is sent to the register, all the bits currently stored in the register are shifted by one, so the last bit is lost (or sent to the next register if you have multiple registers chained together, but there will always be one bit lost at the end of the chain)

Look at this library, it makes it very easy to use shift registers (there are others libraries but I like this one) GitHub - bildr-org/Shift-Register-8-Bit-74HC595: Arduino code to control the 74HC595 8-bit Shift-Register

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.