Hi all,
I seem to be missing something with my 74hc595's, I have a common anode display which I have the 4 segments connected via 4 transistors to the first 74hc595, this seems to work!
The segments are connected to the second 74hc595, as far as I can see these are connected together as they should be.
The problem is I can select displays (I also have 3 LED's connected to the spare 3 lines on the first one, which also works. But I cant change the segments Iluminated! I thought setting the 595 to B00000000 would turn on all segments and B11111111 would turn them off but there is no change?
Does anybody have any suggestions?
I am using 2n3904 transistors with 100R resistors and 1k on the base connected to D0-D4 on the first 595 (which is wired to the Arduino).
my test code is :-
void loop() {
//set latchPin low to allow data flow
digitalWrite(latchPin, LOW);
shiftOut(B00001111);
shiftOut(B10010010) ; // digit select 2=green;4=red; 8=yellow ;16=dig4 ;32 =dig3 ;64 = dig2 128 =dig1
//set latchPin to high to lock and send data
digitalWrite(latchPin, HIGH);
delay(1000);
digitalWrite(latchPin, LOW);
shiftOut(B00001111);
shiftOut(B01100100) ; // digit select 2=green;4=red; 8=yellow ;16=dig4 ;32 =dig3 ;64 = dig2 128 =dig1
//set latchPin to high to lock and send data
digitalWrite(latchPin, HIGH);
delay(1000);
}
which is alternating between the outer 2 and inner 2 digits, but all segments are constantly lit!
Thanks for any pointers