This is my first post on this forum and I would really appreciate any guidance on an issue I’m having. I am building a cricket scoreboard using an Arduino Uno with each individual digit made up of 7 led segments. The digits will be controlled using 9 74hc595 shift registers that go through a uln2003an. The Arduino Uno and the uln2003an are fed by 8-AA batteries (12V), and the shift registers get 5V from the Uno. A sketch is attached showing the circuit setup and connections (due to size limitations only the start of the circuit is shown and the rest of the shift registers are replicated in the same pattern). The only thing missing from that is the LED segments that would be attached to the output of the UL2003AN on one end and to 12V on the other, and an itead bt shield that I will eventually use for interfacing. The LED segments are rated for 12V.
As part of the testing process, I have gone through and tested that I can individually control each and every segment of each digit without any issues. My problem starts when instead of directly turning segments on and off, I let the Arduino Uno figure out what pins to turn based on the digit to be displayed. The attached sketch starts off by defining a number for each of the 10 digits and I am calling a function which uses a switch statement to determine the digit and the pins to turn on (the pin status is stored in an integer array). The digit 0 through 6 work fine, and everything works as expected. When I define all the digits to be equal to 7, only one digit shows a 7, and the rest show 1. A picture of that result is also shown. I can also get all the digits to print an 8 but a similar issue arises when I assign all digits to be equal to 9 (only one digits prints a 9 and the others print a 4). I’m having a hard time seeing where the issue could be.
What’s interesting is that the segment that does not turn on in both instances for the digits is the one at the very top. Any help would be appreciated.
Daisy_Chain_Shift_Register_Code.ino (7.1 KB)