bremme / arduino-tm1637

Arduino library for using a 4 digit seven segment display with TM1636 or TM1637 driver IC
GNU General Public License v2.0
164 stars 62 forks source link

blink method should preserve brightness #14

Closed eadmaster closed 7 years ago

eadmaster commented 7 years ago

the blink method should preserve the current brightness rather than resetting to 100. This way if i reduce the brightness before the calling "begin()" it is not reset.

bremme commented 7 years ago

Thanks for reporting this issue, I agree! This should not be that hard to add to the library. Update: I just fixed it by this commit 019612dbd8be4c9ad1b2207eb8035a4f8b5496ff. I probably should update the README as well, the full signature for the blink() method is:

void    blink(uint8_t blinkDelay = TM1637_DEFAULT_BLINK_DELAY, uint8_t repeats = TM1637_DEFAULT_BLINK_REPEAT, uint8_t maxBacklight=100, uint8_t minBacklight=0);

So you can set the following blink options: delay (how long on/off time in ms), repeats, maxBacklight (how bright is on) and minBacklight (how bright is off).

Hope this helps, closing this issue for now.