How do you program mindstorms to keep doing a task until either the IR OR the colour sensor state changes. I would like to use the wait block but it can only be either the colour sensor or the IF sensor. i want to continue the activity until either sensor changes to a specified condition.
1 Answer
One way of doing this is using a loop and interrupting it.
How it works:
The "Loop Interrupt" block stops all blocks running inside of the loop, so by interrupting the loop after either wait block, it will stop the other wait block. The type of loop doesn't actually matter because we never reach that point. I chose to wait for "Logic" with a value of "False" just so that it is more clear that we are not actually looping here.