03-25-2015 08:22 AM
Hello, I'm trying to make a case structure switch back and forth everytime a boolean LED indicator goes off. I want case one to start when a button is pushed, switch to case two when an LED indicator goes on, then switch back to case one when that same LED goes on again, then case two the next time the light goes on, and so on. The LED is set to go on every ten seconds. So far i have the case structure in a while loop but im not sure how to get them to switch back and forth using this one LED. Any suggestions?
03-25-2015 08:30 AM
03-25-2015 08:33 AM
The condition from your case structure can probably simply come from the same source that is setting the Boolean LED Indicator. What is this source?
03-25-2015 08:39 AM
the source is an elapsed time inside of a seperate while loop, the LED is set to go on every ten seconds.
03-25-2015 08:46 AM
Then you have two asynchronous parallel loops, and you want one of them to receive information (Boolean) from the other in order to determine its state.
If the loop with the elapsed time contains nothing but elapsed time, then consider moving it to the first loop.
Otherwise, you should use a form of synchronization communication, such as a Notifier or User Event, to send data from your loop with the elapsed time to your loop with the case structure.