Hello:
I am building a Speedometer for a large model railroad. I plan to use two SF 6.5" seven segment display to show the speed of a train through the trap area. The controller is an Arduino Nano plus IR emitter/detector pairs for the start and stop sensors.
I used code from bobotstrains for the speed calculations and the code from the large display driver tutorial to drive the seven segments. I used an Adafruit backpack display for early debugging. The large display is powered from an ATX 12v/5v power supply not through the Arduino.
Once I was confident the speedometer was working, I added in the large display. The result was dancing lights in the segments. I tried a few things, check code, check wiring, nothing worked.
I contacted SF tech support and the dtermination was a bad board. I was sent replacement boards and drivers, and did not have to return the originals due to Covid (Thank you by the way).
After procrastinating, I hooked everything up and got the same problem. I created a test program using your code to get a counter display. The result was dancing lights with the occasional digit showing up; usually 2 or 4 in the tens digit.
I then altered the postnNumber function to show single segments: a thru g. I found that each segment would light in sequence, and then one would stay on, while the program continued on. Then the segment would jump the one showing in the serial monitor and run a couple more segments and freeze again, for another cycle or two.
The segment that freezes seems entirely random, and the same for the number of cycles of the sketch. I could not see any repeating pattern in the activity. This is saying timing issue somewhere.
Please note, I modified the code to use D8 for the latch rather than D5. D5 is used as input from one of the sensors.
I tried each of the four digits and got the same result, except with one that gave me some flashing occasionally. All digits were disconnected and attached to the ATX.
I have checked and except for the D8 change and add 7 cases in the switch command, I cannot see any code differences.
I will accept any pointers, advice, must be anatomically possible however.
Do you want to see the code?
Anyway, Thank you.