I need help with programming 2digit 7 segmend display (common cathode). I need for example display to show number 32, I tried some codes from internet, but didn't work.
I am using arduino nano. 7 Segment pins are connected in next order:
A segment on pin 2
B segment on pin 3
C segment on pin 4
D segment on pin 5
E segment on pin 6
F segment on pin 7
G segment on pin 8
DP on pin 9
And for the flag pins of 7 segment:
1st cathode is connected to pin 14
2nd cathode is connected to pin 15
I'll just check that we are using the same terminology. If we have the two digit number 42, the first digit 4 is a flag ? A segment is a part of a digit in the display, for example the middle bar in an "8".
It may be good if you could draw a schematic diagram of the main connections including current limiting resistors etc.
OK. It is usual to have the current limiting resistors on the segments, not the common cathodes [flags]. This give optimal brightness and consistent illumination irrespective of whether a 1 (only 2 segments) or an 8 (all seven segments) is displayed.
A schematic is still needed.
Yes, but it does not show 3 and 2
It shows 4 with G segment off and 1 and it shows DP segments on
I tries counter code from 0 to 99 and it showed all numbers correctly
OK. But that is using a completely different library. What do you want to do ? just write individual numbers to the display ? If so, look in the documentation for the library SevSeg.h.
You will see the methods listed like DisplayString(tempString, 0) etc. for that purpose.