You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that in the code, when you change the brightness or simply turn off the display, you have to do a setBrightness followed by rewriting the message.
It's counterproductive.
If for example I want to flash the display, at worst I have to do either:
for (uint8_t i = 0; i < 5; i++) {
display.setBrightness(7, false);
display.showNumber(_num, true);
delay(250);
display.setBrightness(7, true);
display.showNumber(_num, true);
delay(250);
}
or better not using setBrightness but rewriting the message all the same
for (uint8_t i = 0; i < 5; i++) {
display.clear();
delay(250);
display.showNumber(_num, true);
delay(250);
}
By simply moving the writing of the TM1637_I2C_COMM3 into the setBrightness, the command becomes instantaneous and allows the brightness to be varied or the display to be turned off or on without rewriting a message after the setBrightness.
this command doesn't need anything else to work.
display.showNumber(_num, true);
for (uint8_t i = 0; i < 5; i++) {
display.setBrightness(7, false);
delay(250) ;
display.setBrightness(7, true);
delay(250) ;
}
I noticed that in the code, when you change the brightness or simply turn off the display, you have to do a setBrightness followed by rewriting the message.
It's counterproductive.
If for example I want to flash the display, at worst I have to do either:
or better not using setBrightness but rewriting the message all the same
By simply moving the writing of the TM1637_I2C_COMM3 into the setBrightness, the command becomes instantaneous and allows the brightness to be varied or the display to be turned off or on without rewriting a message after the setBrightness.
this command doesn't need anything else to work.
change in TM1637TinyDisplay.cpp
tested on my current project and works without any observed side effects.
What do you think ?
Stephane
The text was updated successfully, but these errors were encountered: