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