For some reason I can't get my 7 segment dispaly and 74hc595 shift register to work right on my arduino. I can get the segment to turn on one at a time. When I try to do numbers it just doesn't work right? I have clock pin, and data pin to the the arduino. It will try to light up my numbers but will be missing some segments. It will also skip numbers completely for example try to show 1, 4, and 6 and skip the rest. I tried putting a 0.1 cap on the latch also. I have 220 resister running from each pin of the display to the shift register. Here my code:
#define data 12
#define clock 8
byte zero = B11111100;
byte one = B01100000;
byte two = B11011010;
byte three = B11110010;
byte four = B01100110;
byte five = B10110110;
byte six = B00111110;
byte seven = B11100000;
void setup()
{
pinMode(clock, OUTPUT); // make the clock pin an output
pinMode(data , OUTPUT); // make the data pin an output3
}
void loop()
{
shiftOut(data, clock, LSBFIRST, zero);
delay(500);
shiftOut(data, clock, LSBFIRST, one);
delay(500);
shiftOut(data, clock, LSBFIRST, two);
delay(500);
shiftOut(data, clock, LSBFIRST, three);
delay(500);
shiftOut(data, clock, LSBFIRST, four);
delay(500);
shiftOut(data, clock, LSBFIRST, five);
delay(500);
shiftOut(data, clock, LSBFIRST, six);
delay(500);
shiftOut(data, clock, LSBFIRST, seven);
delay(500);
}
Here is my setup:
Q0 is A
Q1 is B
Q2 is C
Q3 is D
Q4 is E
Q5 is F
Q6 is G
DS is my data so its connected to pin 12 on Arduino
ST_CP is my clock( latch ) hav that to pin 8 on Arduino
MR is master reclear and have that to power, try ground and did nothing
SH_CP and OE not connected
I'm using this site
http://www.arduino.cc/en/Tutorial/ShiftOut
this is where the code from
http://www.instructables.com/id/The-74HC164-Shift-Register-and-your-Arduino/