Hi guys
I've a problem that keeps me still ... I have to make a mini-menu on a 16x2 display and i don't know how to do ..
The menu has to work like this:
QUESTION 1 ( forced choice between 4 fixed values ​​set by me)
1 ) first option
2 ) second option
3 ) third option
4 ) Fourth option
QUESTION 2 ( free choice )
User must choose an integer value from 1 to 100
I thought I'd make it all work with only two buttons:
For the FIRST question you would use a button to select one of four options and the second button to confirm.
For the SECOND question I thought that by clicking on the first button there was an int value in the display that increases starting from 1 to 100 and 100 to come back to 0, by pressing the second button would confirm.
Could you help me?
What do you think a menu is? It is a list of choices. Create a function. Call it displayMainMenu(). Make it show the choices on the LCD.
At the appropriate point in your code, call the function. You will then enter a state, waitingForMainMenuSelection.
The only events of interest in that state are the switch states (specifically, the changes to the states). When the "use this option" switch becomes pressed, the value of option at that time is interesting.
When the other switch is pressed, the value of option is incremented. The option variable obviously starts at 0 and is global.