Hello everyone,
I have the Elegoo Most Complete R3 kit. It came with a 5611BS 7 segment LED. I am trying to run tutorial 3.2 for this component, where it is driven by a 75HC595 IC. They are connected to an Arduino UNO. Following is the code:
//www.elegoo.com
//2016.12.12
// define the LED digit patterns, from 0 - 9
// 1 = LED on, 0 = LED off, in this order:
// 74HC595 pin Q0,Q1,Q2,Q3,Q4,Q5,Q6,Q7
// Mapping to a,b,c,d,e,f,g of Seven-Segment LED
byte seven_seg_digits[10] = { B11111100, // = 0
B01100000, // = 1
B11011010, // = 2
B11110010, // = 3
B01100110, // = 4
B10110110, // = 5
B10111110, // = 6
B11100000, // = 7
B11111110, // = 8
B11100110 // = 9
};
// connect to the ST_CP of 74HC595 (pin 3,latch pin)
int latchPin = 3;
// connect to the SH_CP of 74HC595 (pin 4, clock pin)
int clockPin = 4;
// connect to the DS of 74HC595 (pin 2)
int dataPin = 2;
void setup() {
// Set latchPin, clockPin, dataPin as output
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
// display a number on the digital segment display
void sevenSegWrite(byte digit) {
// set the latchPin to low potential, before sending data
digitalWrite(latchPin, LOW);
// the original data (bit pattern)
shiftOut(dataPin, clockPin, LSBFIRST, seven_seg_digits[digit]);
// set the latchPin to high potential, after sending data
digitalWrite(latchPin, HIGH);
}
void loop() {
// count from 9 to 0
for (byte digit = 10; digit > 0; --digit) {
delay(1000);
sevenSegWrite(digit - 1);
}
// suspend 4 seconds
delay(3000);
}
Here is how I have connected it:
None of the segments are lighting up. I have tested with a voltage meter and get a 5v read across the LED for several different inputs to the ground opposite the LED, so it seems that current is running through it. I can also replace selected leads to the LED with single LEDs and they do light up in time with the code turning them on and off. So it seems to work perfectly with single LEDs. I have an image of this running too if you want to see but again I can only embed one image.
What am I doing wrong? If it is relevant, when I got the kit the pins on this component, and also the similar four digit LED, were bent out of place and I had to bend them back to the correct positions. I am having a similar issue with the four digit LED not lighting up as well.
Thank you so much in advance for any help!