How to display a menu after button press ( oled 128x64 & BME280)

Hi all,

I am trying to open a menu with the press of a button. Then with a rotary encoder, make a selection. I can not get my head around how to "create" the infinite "menu" loop and select an item to exit the loop ( or continu depending of the choice I make). I would like to modernize my fathers incubator ( now working with incandescent light bulbs heating and a mechanical thermostat) not very accurate but it is working most of the times. So I gathered some stuff and started buiding.
The code for the menu I have tried is OR showing the menu and is stuck OR is showing the menu only on button press. Maybe someone of you can give me a hint or show me how to continue coding.

I have attached a sort of "flow chart" of what I am trying to achieve and the program code I have so far.

Thanks in advance.

couveuseV1.ino (17.4 KB)

flowChart.pdf (39.5 KB)

It looks like a lot of your code is headed in the right direction. You are using millis() and not delay(). You need to apply that same logic to your menu. Think of a state machine (google Finite State Machine). You step through each of the menus, keeping track with some variable and every time you select something, you react to it (by doing 1 menu level deeper, or setting temp or ????)

I'd start with something simple like just being able to navigate the menus. fwd, back, next level, etc.

Get that working, then dive deeper.