Come back at the first menù

Hi everyone!
I have this "menù codes":

if (btn01State == LOW) {
      count ++;
      if (count > 2) count  = 0;
  if (count == 0) {

     do something


if (count == 1) {

     do other


if (count == 0) {

     do different


I would like if nothing happen within 10 second, the lcd return at the first menù in automatic(count == 0)
Is it right something like this?

if (btn01State == HIGH) && (millis()-start > 10000) && (count != 0){
     count == 0;

Thanks to all for help!

Is it right something like this?

Could be. It's impossible to tell from some snippets. Be sure to post a snippet of an answer after you've tried that.

…ok friends, i need your help.
I modified “Banzi sveglia bomba” code in Control Irrigation sketch and i would like insert a come back at the first display (hour → count == 0) when there is no iteract for a lot of seconds.

Who help me?

Code in attachment

Sketch.txt (10.1 KB)

You really need to stop think of menus as having the same capabilities on the Arduino as they have on the PC. With a menu on a PC, there is a lot of magic that happens with callbacks and menu item classes. There is NO such capability on the Arduino. What you have, instead, is a series of "pages" that you display. Any understanding of where you are in the menu means keeping track of what "page" is displayed.

Any interaction with that "page" is NOT interacting with a menu in the PC sense. You must understand what a "selection" means, based on the "page" that is displayed.

Given that, you need to describe exactly what you mean by "come back at the first display". If that means that enough of iterations of loop() have happened with no "selection" on a "page" for n milliseconds, and, therefore, you want to change the "page" that is displayed, well, feel free to do just that.

You can easily keep track of the time that a "page" was first displayed. On any pass through loop(), you can see of now (millis()) minus then (when the "page" was first displayed) exceeds some value. If so, change the "page" that should be displayed, and then display the current "page". Be sure to reset the time that the "page" is first displayed.

Thank you but... If you could make me a material example with a snippet code for me will be easy to obtain what i want...
Anyway... Thanks