Change variable by buttons, see on LCD

Hi all, I'm currently working on a delayed latching switch, and would like to display the delay setting on LCD, and have it changeable with an up/down/enter type button setup? Is that possible??

Do you have to make some sort of special menu code, or would a simple

void loop() {

print the variable to LCD if switch a pressed, variable = variable + 1 if switch b pressed, variable = variable - 1 }

do the job??

Cheers, Ryan.

You might want to put in a delay so it doesn’t count too fast to see… Perhaps add delay(200) to the loop. It will then count up or down about 5 counts per second as long as the button is down.