I'm using an arduino uno, a Kingbright SA52-11HWA and a 74hc959n. The problem is: I don't know if the SSD has a common anode or cathode and the datasheets don't specify it. I did some test directly connecting some of the pins to the arduino ground through a 1k resistor (the lowest I had) and the middle pins ( 3 & 8 )
to 5V. It worked perfectly. Then I wired everything so:
Your code is a little hard to follow. Suggest you set some consts up to represent the meaning of each of the arduino pins you are using (ie. The 595 pins they connect to).
You should only need 3 pins to control the 595: data, clock and latch. The other 2 can be tied high or low.
"The best way to send data to the 595 is to use the shiftOut function"
Bah - the best way is with SPI!
Create an array with the font to be used:
fontArray[]= {
B00111111, // 0 a bit 7 = dp, 6=g, 5=f, 4=e, 3=d, 2=c, 1=b, 0=a
B00000110, // 1 f b
etc up to 9: g
B01101111, // 9 e c
} // d dp
then send it out:
digitalWrite (ssPin, LOW);
SPI.transfer(fontArray[byte_numberToDisplay]);
digitalWrite (ssPin, HIGH);
don't forget a 0.1uF cap from Vcc pin to Gnd.
Put a current limit resistor between each output pin & the LED pin.
SCK connects to SCLK
MOSI connects to DataIn
ssPin (generally 10) connects to SRCK
MRCLR connect to+5
OE/ connect to Gnd, or a PWM pin if you want brightness control
You indicated common anode - then flip all the bits in the array, so 0 is on and 1 is off.
11000000 = 0
11111001 = 1 etc