Go Down

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

max713

Hi,

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

Thanks,
max

magagna

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.

max713

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

guix

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

http://code.bildr.org/project/Shift%20Register%208-Bit%20-%2074HC595/Arduino

Nick Gammon

I have a page about the 595 chip:

http://www.gammon.com.au/forum/?id=11518

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);
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Sparkie

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.

Sparkie
Don't Shoot The Messenger

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up