Go Down

Topic: 595 Shift Registers (Read 501 times) previous topic - next topic

tlavite

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.
Tyler LaVite
tlavite@gmail.com

John_Ryan

http://www.arduino.cc/en/Tutorial/ShiftOut

tlavite

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.
Tyler LaVite
tlavite@gmail.com

Grumpy_Mike

#3
May 21, 2009, 04:30 pm Last Edit: May 21, 2009, 04:32 pm by Grumpy_Mike Reason: 1
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.

gabebear

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

Go Up