Bumper Switch#

Introduction#

The Bumper Sensing category includes blocks that detect whether a VEX IQ (2nd gen) Bumper Switch is currently being pressed. These blocks return Boolean values that can be used in conditionals, loops, or event-driven logic to respond to collisions or user input.

Bumper pressed?#

The Bumper pressed? block returns if a Bumper Switch is currently being pressed or not pressed. This block returns a Boolean value:

  • True - The Bumper Switch is being pressed.

  • False - The Bumper Switch is not being pressed

    <[Bumper1 v] pressed?>

Parameters

Description

bumper switch

The Bumper Switch to check, configured in the Devices window.

Example

    when started :: hat events
    [Don't print the message until the bumper is pressed.]
    wait until <[Bumper8 v] pressed?>
    print [Bumper was pressed.] on [Brain v] ▶