06-28-2024 08:55 PM
I have a state machine with three states. The goal is to turn the LED on, then off before moving to the next state. In other word, the led is in the level 2 state, I want the LED to keep turning on and off before moving to level 3. Is this possible? How can this be done?
Solved! Go to Solution.
06-29-2024 12:44 AM
Add two more states, one for led on and one for off.
06-29-2024 12:38 PM
@GRCK5000 wrote:
I have a state machine with three states. The goal is to turn the LED on, then off before moving to the next state. In other word, the led is in the level 2 state, I want the LED to keep turning on and off before moving to level 3. Is this possible? How can this be done?
You (indirectly) answered your own question. If you are in Level 2, where the LED should turn on, then off, then on, then off (almost forever), how would you code it? You want Level 2 to repeat, but to reverse the value of the Boolean "LED". Under this condition, what is the next state after Level 2 (in this "forever" mode)?
You now have another thing you want to do -- get into and out of "Forever Mode". If "Forever" is true, the next state after Level 2 is Level (fill in the blank here), and if "Forever" is false, the next state after Level 2 is Level (another fill-in-the-blank).
[Please forgive me for not giving you a nice VI that simply does this -- you'll only learn to ask others to do your thinking for you. But if you stop and ask questions about the task you set for yourself, as I've tried to do, above, an answer (maybe not the answer, whatever that means) should become obvious.
Bob Schor