Originally, I had a simple program to move until the robot hit a wall, then it reversed and turned and moved again, repeated to infinity. It works by turning the motors on, waiting for input from the touch sensor, then reversing, turning, and continuing. Now I want to add a second wait on the touch sensor to trigger the reverse and turn sequence, but I can't add two different ports to wait from, or have two different triggers to start the reverse and turn. Is there any way to have a trigger from two different wait inputs?
You can do this with parallel programs and a logic variable. You will need 3 loops, one for each sensor and one for the motor. In the sensor loops, wait for the touch sensor to be pressed and then set a logic variable to true. In the motor loop, have a switch block that tests the logic variable. If it is true, reverse and turn around and then set the logic variable to false. If the logic variable is already false, just go forward.
Here is another pattern that watches more than one sensor. Instead of parallel code blocks setting a variable value, this code combines sensor outputs to feed a logic block which feeds a switch. No variable is used.
Note that only the touched side of the switch statement is used. Not an important difference, I just find it easier to follow.
The other pattern might be described as event driven, which is used widely in programming.