I need to make an arduino program that allows me to switch between 3 different tasks with the help of only one push button.
It should go back to Task 1 once we cross Task 3 by pushing the switch
(eg. Task 1: Read input from LDR Task 2: Glow the red LED Task 3: Display some text)
I have tried a lot but am not getting how to do it. Also the switch has to be debounced to prevent any errors but only through software, not hardware debounce.
How do I solve this entire problem?
The switch I am using is LOW when pressed down and HIGH in normal state.