Hey,
I would need some help for my project, beforehand u need to know that I'm not that good with programming, so don't expect too much from me. I need to create a project that has 2 Mode's. To display what the programme should to i created some sort of flow chart. I really would appreciate your help, how i can i to do this in Arduino. I thought of some sort of state machine, but to be honest i dont really get it, how it works in Arduino, I already read a few guides, but they didnt really help me to understand it. The flow chart can be found in the attachments.
Your states look not well designed. How can you distinguish in Mode 1 between the conditions "Button pressed" and "Button hold..."? It's okay to have multiple (conditional) follow states, but the conditions must be unambiguous.
Also for Mode 2, if reached by Button down for 5 sec the next move on Button pressed will be made immediately.
Also the "Switch..." nodes should become states, which are left only under certain conditions.
In every state there is one or more conditions that have to be checked. Once a condition is met, a related action is executed and the state moves on to the related follow state. In code a switch statement forks to the current state, where the checks for the various expected conditions are made. If a condition is true, the related action is taken and the state variable is updated. Then the loop continues by forking to the now current state.