maxint-rd / TM16xx

Arduino TM16xx library for LED & KEY and LED Matrix modules based on TM1638, TM1637, TM1640 and similar chips. Simply use print() on 7-segment and use Adafruit GFX on matrix.
164 stars 34 forks source link

Request: Brightness scaled [0-255] instead of [0-7] #51

Closed ArnieO closed 1 month ago

ArnieO commented 1 month ago

One byte is commonly used for setting the brightness of LEDs, with value ranging from 0 to 255. This library sets brightness in seven steps, from 0 to 7.

In my project I use an ambient light sensor to set the intensity of both 7-segment displays and LED strips on the same enclosure surface. It would be very useful to be able to adjust the 7-segment brightness in finer steps from 0 to 255.

Maybe the setIntensity() function could get an additional parameter to accommodate this request?

maxint-rd commented 1 month ago

Hello @ArnieO , I have to disappoint you, Unfortunately almost all TM16xx chips are limited to 8 levels of intensity/brightness. As you can see on page 7 of the TM1618 datasheet, that chip also only has 8 levels.

There are only a few exceptions that I know of:

For this library I think I'll stick to the most common things. The universal chip supporting class that I've been working on supports all common features for those chips that use 2 or 3 wire interfaces, allowing for dare devils to connect chips that I don't have in my collection (yet). I hope to publish that class later this month or the next.

ArnieO commented 1 month ago

OK - so it is a limitation of the TM16xx (in my case TM1618) chip, understood.

Thank you for your rapid clarification!