I assume you are using either a state machine or a parallel task to do this?
You'll probably get useful answers faster if you post your code.
See
attachment. The boxes are states, the arrows are events which cause the state to change.
You might want to
add additional events to allow the toggle switch to cycle through all the states.