Go Down

Topic: Shift Register Library (Read 586 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?


If you use 74HC595 shift registers, you could try this one


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

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

shortcuts: alt+s submit/post or alt+p preview