Go Down

Topic: Shift Register Library (Read 582 times) previous topic - next topic



I have 4 daisy-chained shift registers. I just wanted to know if anybody knows a special library which makes programming much easier.



Your question is a little vague...what do you want to do with them?

There's the SPI library, you can use that to send data to shift registers faster than shiftOut().

There's the ShiftPWM library (http://www.elcojacobs.com/shiftpwm/) if you want to blink some LEDs...

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.


I want to control a matrix without using shiftout(), because that would enlarge my program wouldn't it?


Nick Gammon

I have a page about the 595 chip:


Here (from that page) is how to daisy-chain 4 shift registers, it hardly takes a lot of code:

Code: [Select]

  digitalWrite (LATCH, LOW);
  SPI.transfer (0xAB);
  SPI.transfer (0xCD);
  SPI.transfer (0xEF);
  SPI.transfer (0x42);
  digitalWrite (LATCH, HIGH);


Hi Nick

I went to your site and seen some of the code for the shift registers, and thought you might be able to help me.

What is SPI in your code.

I built a 4x4x4 led cube and am trying to creat a code to test each one of the leds from an X,Y,Z access.
Then eventually randomize the pattern.

If you want I could send the code I found and converted.

Don't Shoot The Messenger

Nick Gammon

Go Up