Bumper Switch#

Introduction#

The Bumper category includes blocks that monitor the VEX IQ Bumper Switch. The Bumper Switch is a mechanical switch that completes a circuit when pressed, allowing the robot to detect presses and releases.

Below is a list of available blocks:

  • Bumper pressed? — Returns a Boolean whether the Bumper Switch is being pressed.

  • when Bumper — Executes the attached stack of blocks when the Bumper Switch is pressed or released.

Bumper pressed?#

The Bumper pressed? block returns a Boolean indicating whether a Bumper Switch is being pressed.

  • True — The Bumper Switch is being pressed.

  • False — The Bumper Switch is not being pressed

<[Bumper 1 v] presionado?>

Parameters

Description

bumper switch

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

Example

cuando empezó
[Back up and turn whenever the bumper runs into an object.]
para siempre
unidad [adelante v]
si <[Bumper 1 v] presionado?> entonces
unidad [atrás v] para (100) [mm v] ▶
girar [derecha v] por (90) grado ▶

when Bumper#

The when Bumper block runs the attached stack of blocks when the selected Bumper Switch is pressed or released.

cuando [Bumper 1 v] [presionado v]

Parameters

Description

bumper switch

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

actions

Determines when the attached stack of blocks will execute:

  • pressed
  • released

Example

cuando [Bumper 1 v] [presionado v]
[Move forward when Bumper Switch is pressed.]
unidad [adelante v] para [200] [mm v] ▶