I have lcd connected to microcontroller, and i want to sore numbers using external push buttons, but i want to store values before entering the processing mode. for instance microcontroller is off then i want to push a button to enter (X mode) to adjust parameters then exit this mode and restart to enter the operation mode( like enter configuration mode of devices while they are turned off). How to do this?
I think you will have no difficult looking for examples of state machine (SM) implementations, so instead I would suggest you just draw a draft of the whole process by focusing on the menu options where each SM state represents one menu option, and each subsequent sub-menu option, a state right below, at which you can go upon a combination of the previous state and pressing one key. On the code side, you can implement a state with the switch...case statements.