数码管公共脚接电阻,如何解决因亮多段而引起的亮度不同

2020-01-30 13:34发布

目前公司提出节约成本,故而提出把数码管的8段码的电阻取消,改为在公共脚串接.但在写程序出现开多段和少段时亮度不同的情况.现在我有想到反过来扫描,即扫段码(通常我们是扫描位码).但想了很久也没有想出应该如何编写程序.不知各位有没有更好的程序方法来解决这种问题.
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
50条回答
millwood0
2020-02-04 05:23
数码管公共脚接电阻,如何解决因亮多段而引起的亮度不同


Easy:

Optimal solution: don't do it. You can spare a few resistors, cannot you?

Suboptimal solution #1: run the leds hot. leds at 15ma are roughly as bright as leds at 20ma or 25ma, etc.

Suboptinal solution #2: dynamically alter the display duration based on the number of segments lit. If you are lighting up two segments, "1" for example, display it for 1ms; if you are lighting up 5 segments ("5"), you display it for 2ms. This can be easily done with an array and loading up the timer offset / top in the isr.

一周热门 更多>