08-06-2011 03:37 PM - edited 08-06-2011 03:38 PM
Greetings people,
I have a pretty basic question, I am working on this state machine architecture, but the problem is the state gets 'stuck' because of loop that iterates infinite no of times, the while loop inside the case structure is causing the trouble, when the "OK" button is pressed the Tank starts to fill in a continuous manner and when "OK" button is pressed again(case structure goes 'false') it pauses (but it remains in that state forever) and no transition to next state occurs, when pressing case 3 button.
How do switch to next state, even though the loop runs continuously ?
Kindly help.
08-06-2011 03:49 PM
08-06-2011 03:51 PM
Try putting a wait statement inside that loop. Right now it is running as fast as the CPU will allow to poll the status of that boolean.
I don't know why you need a loop inside a loop like that. I think you could merge the two loops so that the true and false cases can handle the differences.
08-06-2011 05:50 PM
Can you please elaborate, I did put the timer for polling, but it didn't work.. 😞
08-06-2011 08:17 PM