Push button

How can I have a push button stay high for a set time once pressed? Like an off delay, but I don’t want to pause the program with a delay command.
Thanks

You can hold it down.

Whatever you do, unless you take that suggestion, the button will not stay high. Your code will just continue doing what it does after the button goes low, the button cannot actually stay high. (unless it is some fancy button with a timer or something, but I’m assuming not.)
The solution in the code depends on what you are trying to do. Blink a light? Play a sound? Or What?

Thanks, I have a serial LCD display. I would like the backlight to come on when the button is pressed then stay on for say 2 min. then shut off. But I don’t want the loop to pause.

You could check out the blink without delay example on the arduino website, or in the examples folder of the IDE.

Your code would first store the value of millis() into an unsigned long. Then it would check to see if millis() minus the unsigned long < the interval in milliseconds. If that difference is greater than the interval, then the light should be turned off. If the difference is less than the interval, then the light stays on and it keeps repeatedly checking.
In the loop where it is continually checking you can put other functions and things to do whatever else you want it to do.

Or you could even leave isolate the backlight from the arduino. Use the hardware solution that Richard Crowley suggested, but instead of connecting it to an arduino input, just connect it to the backlight. Advantages: no code used to drive the backlight whatsoever. Disadvantages: limited, i.e. you can't control it through software. (well you could, but if you wanted to, you wouldn't take this solution.)

Thanks again, this forum is the best!