Arduino Forum

Forum 2005-2010 (read only) => Software => Troubleshooting => Topic started by: tyler_lavite on May 21, 2009, 01:56 am

Title: 595 Shift Registers
Post by: tyler_lavite on May 21, 2009, 01:56 am
I need some help programing with shift registers... i am driving 3 8x8 LED displays and need some good resources on shift registers and Arduino programing for a compete software beginner.
Title: Re: 595 Shift Registers
Post by: John_Ryan on May 21, 2009, 03:16 am
http://www.arduino.cc/en/Tutorial/ShiftOut
Title: Re: 595 Shift Registers
Post by: tyler_lavite on May 21, 2009, 04:44 am
I have read that entire document and it makes literally not an ounce of sense to me for writing a sketch for controlling 3 matrices with shift registers.
Title: Re: 595 Shift Registers
Post by: Grumpy_Mike on May 21, 2009, 04:30 pm
Some of the code from: http://arduino.cc/en/Tutorial/ShftOut21

in setup add:-
rowEnable = 1;

then in the main loop add the lines in red
void loop() {
 //count up routine
 for (int j = 0; j < 256; j++) {
   //ground latchPin and hold low for as long as you are transmitting
   digitalWrite(latchPin, 0);
   //count up on RED LEDs
   shiftOut(dataPin, clockPin, j);
   //count down on BLUE LEDs
   shiftOut(dataPin, clockPin, 255-j);
   //enable the row
   shiftOut(dataPin, clockPin, rowEnable);
   rowEnable = rowEnable <<1;
   if(rowEnable >0x80) rowEnable = 1;
   //count up on Green LEDs
   shiftOut(dataPin, clockPin, j);
   //return the latch pin high to signal chip that it
   //no longer needs to listen for information
   digitalWrite(latchPin, 1);
   delay(1000);
 }
}

This will display very slowly but you will get the idea.
Title: Re: 595 Shift Registers
Post by: gabebear on May 31, 2009, 10:03 am
two 595s can work together something like a MAX7221. You may want to read that documentation first.

http://www.arduino.cc/playground/Main/MAX72XXHardware#WiringLedMatrix