Limit Sensing#
For Limit Switch Sensing blocks to appear in VEXcode, a Limit Switch must first be connected to VEXcode V5.
For more information about the Limit Switch, read Using the V5 3-Wire Bumper Switch v2 & Limit Switch.
Limit Pressed#
The Limit Pressed block is used to report if the Limit Switch is pressed.
<[LimitSwitchA v] pressed?>
The Limit Pressed block reports True
when the selected Limit Switch is pressed.
The Limit Pressed block reports False
when the selected Limit Switch is not pressed.
Choose which Limit Switch to use.
In this example, the Brain will print a message on its screen the first time the Limit Switch is pressed.
when started :: hat events
[Don't print the message until the Limit Switch is pressed.]
wait until <[LimitSwitchA v] pressed?>
print [Limit Switch was pressed.] on [Brain v] ◀ and set cursor to next row