questions about Timer

Hi!
I do a project using Nextion, and I navigate between screens.
I need that when the user does not interact with any screen for X seconds, the program returns to the home screen. Is there a library in which I can control this time?

Thank you!

When the user touch the screen, record the value of millis(). In the main loop, compare the actual value of millis() with the recorded value. If difference is greater than X, stop comparing and return to home screen.

timeObj myTimer(X * 1000.0);

if (myTimer.ding()) {
returnToHome();
}

//when an interaction happens call..

myTimer.start();

Install LC_baseTools using the IDE library manager for this and other delightful goodies.

-jim lee

Thank you, @JimLee

It worked!

You are very welcome!

Have fun!

-jim lee

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.