Thank you for getting back to me.
I have tried millis timing already but just doesn’t work for me because the timer start counting when the Oled is on and i am using it. meaning the Oled can be off even when is in use.
That is also how you would use the millis timer. You need to make sure you update the lastTouch value every time the button is touched, with the current timestamp. You're constantly comparing the time to the last time the button was touched, so as long as you keep that 'lasttouch' time updated, it shouldn't ever turn off the screen until the time has passed.
I’m wondering if you need to reset the timer after every call to display? I assume when you say “using it” you mean that you are changing programmatically what is shown on the screen.
When I say “using” it I mean as I continue to press the touch buttons (going from one menu to another) the UI should be on during that time and then 5 min after i am done pressing the touch buttons the UI should turn off.
I get that. I’m just not too sure how I can approach that method really. I will appreciate it if you could show me with a small code for just a hint please .