| How can I tell which event has been triggered? |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
If you have more than one event, and only one event land, they all land at the same place. However, this does not mean that there is no point in having multiple events. Instead, this brings up the issue of how to tell which event has been triggered.
To determine which event is being triggered, use an event fork, and end the program only when one of the events has been triggered. Then, if the program stops, it is easy to tell which event has been triggered, since only one event could have stopped the program.
In the following program, if a light sensor event is triggered then the program will end, but if the touch sensor event is triggered the robot will do something, then continue monitoring for the light event.
Here is an example of using an event fork to figure out which event has been triggered:

AG ses
kw
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Related Questions |
|
No related questions were found.
|