messy code I'm sure but if say "DownButton" is pressed while the millis has already started counting, because it's already inside the If statement, will it cancel or just ignore the input and continue onto turning off the backlight?
Thanks
///////////////////////////////////////////////////////////
if(DownButton == LOW){
 if(UpButton == LOW){
  if(RightButton == LOW){
   if(LeftButton == LOW){
     if(millis() > time_now + timeout){
         time_now = millis();
         //Serial.println("Hello");        //Check if any activity, if none, start a 1 minute timer to turn off backlight.
             lcd.noBacklight();
    }
   }
  }
 }
}
///////////////////////////////////////////////////////////
For example, if all my buttons are low, the IF can run because its requirements are met.
what then happens if I press a button and set it high? Does the IF stop and the milli timer stop. Or does it continue to run as the IF requirements are already met?
int UpButton = digitalRead(22);
int DownButton = digitalRead(23);
int LeftButton = digitalRead(24);
int RightButton = digitalRead(25);
const long timeout = 60000; //1 minute timer
int long time_now = 0;
if(DownButton == LOW){
 if(UpButton == LOW){
  if(RightButton == LOW){
   if(LeftButton == LOW){
     if(millis() > time_now + timeout){
         time_now = millis();
         //Serial.println("Hello");        //Check if any activity, if none, start a 1 minute timer to turn off backlight.
             lcd.noBacklight();
    }
   }
  }
 }
}
what then happens if I press a button and set it high? Does the IF stop and the milli timer stop. Or does it continue to run as the IF requirements are already met?
When an input goes HIGH, if(millis() > time_now + timeout) will not execute.
However, millis will still continue to increment every one millisecond.