To simplify my problem:
1. I have two buttons and a string indicator on my front panel.
2. My code contains a state machine.
3. In state X, I need to update the string indicator with a new string once every second UNTIL one of the buttons is pressed.
4. When one of the buttons is pressed, I need to switch to a different state, depending on which button was pressed.
I'm having trouble coding the parallel processing part of this. I have the code to update the string indicator once every second and I have the code to switch to a different state depending on which button was pressed. But I can't get them to work together so the updating of the string indicator immediately stops and moves to the next state when either button is pressed.
Any thoughts?