What menu is displayed is controlled by value of 'menu' in 'switch..case' statements. This is still work in progress, but works very well so far.
It won't be huge or universal menu system for commercial use. I do NOT intend to give super advanced and flexible menu system here. It's just for my hobby project and to remind myself how to use C++. I'm not IT expert or so.
- 'up' & 'down' buttons control value of 'menu', hence which menu screen is displayed.
'subMenu' flags if I entered ('subMenu=1') menu item to scroll through options or not ('subMenu=0'). See my 1st. post (i.e. in '2.Temp.scale' menu item I have '*C', '*F', 'K' options). - Pressed push button is HIGH, released is LOW.
'btn3_state' is for push button 'Enter/Exit' and it works as a toggle switch here. If I press 'btn3' it changes from LOW to HIGH (and stays HIGH). Then I can press either 'down_btn' or 'up_btn' to scroll through options in selected menu. Pressing 'btn3' again flips 'btn3_state' from HIGH to LOW (and stays LOW), that will save (not coded yet) selected option and takes me back to scrolling main menu again (see attached picture).
- '-/down' button is used (as push button) to change set temperature down, scroll menu/screen down, change to previous option of selected menu item.
- '+/up' button is used (as push button) to change set temperature up, scroll menu/screen up, change to next option of selected menu item.
- 'Enter/Exit' button is used either as push button or toggle switch. As toggle switch to enter chosen menu item to scroll option and to exit chosen menu item.
- 'Enter/Exit' button used as push button is used to accept/select '6.Exit' menu item to leave Settings menu and go back to main screen (work in progress).
I'm sure your sketch can help me in the future, but first I have to learn more about C++ to understand what's in it. I will be happy to analyze and play with it. Thank you for your help.
