Is there an easy way to continuously monitor a single input and jump to a different section of code and stay there?
I understand the interrupt subroutine, but that is the problem: it's a subroutine and when it finishes it jumps back to where it was before the interrupt occurred. I don't want to go back, I want to start executing different code and stay there until the button is pressed again.
Eg:
Mode 1 runs on powerup.
Mode button is pressed, Mode 2 runs.
Mode button is pressed, Mode 3 runs.
..
..
..
Mode button is pressed, Mode 1 runs.
Thanks
I understand the interrupt subroutine, but that is the problem: it's a subroutine and when it finishes it jumps back to where it was before the interrupt occurred. I don't want to go back, I want to start executing different code and stay there until the button is pressed again.
Eg:
Mode 1 runs on powerup.
Mode button is pressed, Mode 2 runs.
Mode button is pressed, Mode 3 runs.
..
..
..
Mode button is pressed, Mode 1 runs.
Thanks