I recently purchased a SMD LED shield to learn both multiplexing LEDs with shift registers (74HC595) and surface mount soldering. And for the first time at SMD, i think i did a pretty good job soldering. Now I wanted to try their sample coding for this shield to get some ideas......but none of their sample code did anything special or didn't work properly. There shouldn't be any reason none of it would work properly besides faulty coding as I've made my own sample code to test the shield and it worked fine. Honestly, a lot of their sample coding may have looked like it would of done something elaborate, but all i got was all the 8x8 LEDs blinking or a single line of LEDs solidly lit. I've checked the pin outs, there is no additional libraries needed for the 74HC595s, and a lot of the times they enabled serial but did nothing with it. I couldn't even find another individual online who may have built this and coded it as well. So I however, have made my own sample coding, a chase sequence that is pretty compact in terms of coding footprint.
int latchPin = 8;
int clockPin = 12;
int dataPin = 11;
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
for (int i = 0; i < 8; i++) {
byte rowBitsToSend = 0;
byte columnBitsToSend = 0;
digitalWrite(latchPin, LOW);
bitWrite(columnBitsToSend, i, HIGH); //advance and light up column
shiftOut(dataPin, clockPin, MSBFIRST, columnBitsToSend);
bitWrite(rowBitsToSend, 8, HIGH); //enables all LEDs in the row
shiftOut(dataPin, clockPin, MSBFIRST, rowBitsToSend);
digitalWrite(latchPin, HIGH);
delay(100); //controls speed, fastest visible is about a 25ms delay
}
}
On that note I was wondering if there was anyone that knows of a simple way of addressing each pin of the 74HC595s individually so I can start making some more interesting light sequences?
There was another project I was trying to work on in the past with 74HC595s, but all I ended up doing was using someone's pre-constructed library to make visible numbers with 7 segment LEDs....which on top of that didn't help me learn anything. AND I attempted to chain 2x shiftout registers together and all they would do is hand each other's numbers down to each other.