Time restricted input line

Is there a possible way to skip input line if the user doesn't enter anything for 1 second.
Basically I have an input line (let's say the variable is x),waiting for input, but if the user doesn't enter anything for 1 second , it should move forward with the program, with a default value assigned to x.
Just curious to know if it's possible.
Hope my question is clear.
Thanks.

(deleted)

If you are reading input from Serial, you can set the timeout parameter. If you are waiting for input from a keypad or buttons or something else, you will have to do the timing/timeout yourself

1 Like