Skip to content
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

How to clear display? #25

Open
rozrabiak opened this issue Mar 1, 2024 · 2 comments
Open

How to clear display? #25

rozrabiak opened this issue Mar 1, 2024 · 2 comments

Comments

@rozrabiak
Copy link

rozrabiak commented Mar 1, 2024

Hi, after restart cpu display always show last digits.
My setup:

  tmDisplay.begin();  
  tmDisplay.setBrightnessPercent(90);
tmDisplay.clearScreen();

Above set's display to 00.

 tmDisplay.offMode();

Above switch off display's, but when I turned ON again - on displays I have last number's :-(

What I can do to clear registry (buffer) in TM1637 using this library?
I want to have my display without any digits after start program.

Regards!

@rozrabiak
Copy link
Author

rozrabiak commented Mar 2, 2024

I need turn ON only colon - as status.

And another question, how to select (I have two displays) which colon turn ON?
Now when:

tmDisplay.colonOn();

Two colons are turned ON :-)

@AKJ7
Copy link
Owner

AKJ7 commented Feb 26, 2025

Hi, after restart cpu display always show last digits. My setup:

  tmDisplay.begin();  
  tmDisplay.setBrightnessPercent(90);
tmDisplay.clearScreen();

Above set's display to 00.

 tmDisplay.offMode();

Above switch off display's, but when I turned ON again - on displays I have last number's :-(

What I can do to clear registry (buffer) in TM1637 using this library? I want to have my display without any digits after start program.

Regards!

Hey,

sorry. It has been almost a year since you posted your question. I wanted to run and test the issue myself but i never got to doing so. Is the problem still an issue? If not then try this:

You see the library caches the last display value so it wouldn't need to physically send it to the display device every time. It is also the trick used to handle animations.

#include <TM1637.h>

TM1637 tm(2, 3);

void setup()
{
    tm.begin();
}

void loop()
{
    // Display Integers:
    tm.display(1234);
    delay(1000);

    tm.clearScreen();
    delay(1000);
}

does exactly what you are expecting. clearScreen() clears the buffers, resets the animation and displays nothing on the display. Try it here: https://wokwi.com/projects/423979794621847553 .

If there are no other questions, make sure to close the ticket.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants