-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEWBIE] Display seconds with blink dots ? #13
Comments
Hello, I think I found a new approach to do what I want, but I'm still looking for the best way to do it.
|
Hi @BullzLabz, thank you for the nice words! Are you looking to create an animation that includes using the decimal dots? If so, yes you can. 0x80 is the value to turn on the "dot". You can play around with the animation tool to see the different possibilities: https://jasonacox.github.io/TM1637TinyDisplay/examples/7-segment-animator.html which I suspect you have been using. Here is 1234 with blinking dots: /* Animation Data - HGFEDCBA Map */
const uint8_t ANIMATION[4][4] = {
{ 0x06, 0x5b, 0x4f, 0x66 }, // Frame 0
{ 0x86, 0xdb, 0xcf, 0xe6 }, // Frame 1
{ 0x06, 0x5b, 0x4f, 0x66 }, // Frame 2
{ 0x86, 0xdb, 0xcf, 0xe6 } // Frame 3
}; Based on your 2nd code example it looks like you just want to flash all the LED segments. Your approach would also need you to set at least one segment value (brightness value is sent as part of the data update, not by itself) I'm not where I an try this right now but I think something like this would work: uint8_t data[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
void dotsBlink(uint8_t blinkDelay, uint8_t repeats, uint8_t BRIGHT_HIGH, uint8_t BRIGHT_LOW) {
for (uint8_t i=0; i < repeats; i++) {
setBrightness(7, false); // turn backlight off
setSegments(data, 0, 5);
delay(blinkDelay);
setBrightness(7, true); // turn backlight on
setSegments(data, 0, 5);
delay(blinkDelay);
}
// restore backlight
setBrightness(_backLightValue);
setSegments(data, 0, 5);
} Alternatively, you would keep track of the display state in a local variable (what is it displaying) so you clear and set the values on the Display, basically blinking all the dots. As an example, I have a countdown timer example that flashes the display when countdown is reached: uint8_t dots = 0b01000000; // Add dots or colons (depends on display module)
if (timeElapsed >= countDown) {
// If we hit zero - flash every second
since = (long)((timeElapsed - countDown) / 500);
if (since % 2) {
display.clear();
}
else {
display.showNumberDec(000000, dots, true);
}
} |
Hello,
Thank @jasonacox for your hard work on this usefull library! 👍🏻
I would like to create a custom timer but being limited to 4 digits I would like to use the "dots" to display the seconds with blink effect/animation.
I created this animation thanks to your super tool but being beginner I can't place it in my code. Could you help me ?
The text was updated successfully, but these errors were encountered: