Controling 4 digit 7segment LED Display using 74HC595 shift register

I'm having troubles trying to use two 595 shift registers to output numbers on a 4 digit 7seg display.

Here is the date sheet:http://www.componentschip.com/details/Texas-Instruments/74HC595D.html


I've gotten to the point of displaying numbers correctly, but I'm now having the issue that the output is flashing some garbage between the digits being displayed. How do I prevent this from happening?

I'm pretty sure the issue is that as I'm using bytes to send to the registers it is latching between bytes being displayed.

Here is my code

int latchPin = 5;
int clockPin = 6;
int dataPin = 4;

int i = 0;

int waitTime = 500;

// digits from the right
byte colDig[4] =
{
B00001000, // digit 1
B00000100, // digit 2
B00000010, // digit 3
B00000001, // digit 4
};

const byte digit[10] = //seven segment digits in bits
{
B11000000, // 0
B11111001, // 1
B10100100, // 2
B10110000, // 3
B10011001, // 4
B10010010, // 5
B10000010, // 6
B11111000, // 7
B10000000, // 8
B10011000, // 9
};
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
Topic archived. No new replies allowed.