Library | Building | Programming | Quick Guides Home | Quick Guides to Building | Quick Guides to Programming | LVLM | WeDo
NXT - Multiple Events
Details for NXT - Multiple Events
PropertyValue
NameNXT - Multiple Events
Description

 

Just like single events, multiple events can be setup in the same code to track different variables. The only difference is that all event structures must have the same event landing. This means that if 3 events are setup and only one triggers, the code will have to determine which one of the 3 changed so it can perform the appropriate action. In this example, two push events are used to control the motion of a car. After setting up both events, monitoring is started and the code is forced into an infinite loop. This is done to prevent the code from reaching the event landing block prematurely. If the red event (touch sensor 1) is triggered, the code will take the upper path in the event fork and stop motor A. If the red event was not triggered, then by default, the blue event must have been triggered and the code will take the bottom the path of the fork. Three or more events can be checked by increasing the number of event forks.

FilenameNXT_multiple.events.vi
Filesize56.07 kB
Filetypevi (Mime Type: application/octet-stream)
Creatormu579
Created On: 06/11/2006 00:00
ViewersEverybody
Maintained byEditor
Hits6948 Hits
Last updated on 06/11/2006 16:07
Homepage
CRC Checksum
MD5 Checksum
Home | About Us | Contact Us
© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.