SevSeg icon indicating copy to clipboard operation
SevSeg copied to clipboard

Colon Support

Open RodjGaming opened this issue 3 years ago • 4 comments

Hi there,

I have a 4 digit 7-segment display with an additional colon and a 3rd upper dot(to the right of the 3rd digit). These dots(L1,L2,L3) have their own common cathode/anode with the other end connected to segments A, B, and C individually, basically making it its own digit. Below are the pictures from the datasheet of the display: image image

I would like if native colon support could be added for components like this, or if there is another way to achieve lighting up L1 and L2 currently in the library.

RodjGaming avatar Apr 12 '22 04:04 RodjGaming

Hi, There is no native support for this. If I were you, I would treat L1,L2,L3 as DIGIT 0, where segments A,B,C correspond to L1,L2,L3. You can then call setNumber() with a number 9999 or less. Follow this by setSegmentsDigit(0, b00000CBA) to override the digit code of digit 0 (where CBA are the states of L3, L2, & L1)

DeanIsMe avatar Apr 13 '22 15:04 DeanIsMe

Hi RodjGaming, Is there a reason you're not just using digitalWrite for this, to control the respective pins? If you want to control brightness of those dots you can also use analogWrite if the pins they are connected to support pwm.

basgoossen avatar Jan 15 '23 10:01 basgoossen

Hi, the issue is that these dots are multiplexed like if they were digits. If you controlled the pin with regular digital write, you'd not only control the colon, but also the additional dot on the top.
Using PWM on those segments is a bad idea because you have no control over when both anode and cathode are enabled - theoretically, if the library ran at just the right speed, the segment's won't light up until some high percentage of PWM because the enabled time of the PWM could be synced with the disabled time of those particular common lines.

machmar avatar Jan 15 '23 15:01 machmar

I did not check the connection schema carefully enough. My display has a separate anode and cathode for those led's (and is hence using 14 pins instead of 13). i get your point for PWM, however a higher PWM frequency (arduino supports up to 62khz) mitigates this issue.

basgoossen avatar Jan 15 '23 16:01 basgoossen