Bumper Sensor - Robot Features - VEXcode VR

The VEXcode VR Robot has two Bumper Sensors. The Bumper Sensor can be used with VEXcode VR to report if a Bumper Sensor is pressed on the VEXcode VR Robot.

The following article will cover:

  • What is a Bumper Sensor?
  • Common uses of the Bumper Sensor.
  • Where do I find the Pressing Bumper block?
  • How would I program the Bumper Sensor?

What is a Bumper Sensor?

A Bumper Sensor is a switch. The Bumper Sensor reports if it is pressed or released. 

  • The Bumper Sensor will report a sensor value of 1 when the bumper sensor is being pressed.
  • The Bumper Sensor will report a sensor value of 0 when the bumper sensor is released.

VEXcode VR Bumper Callout

The Bumper Sensor’s value can be viewed in the Dashboard. For more information about the Dashboard, check out the VEXcode VR Dashboard Article.

Dashboard bumper


Common Uses of a Bumper Sensor

The Bumper Sensor can be pressed by walls in the Wall Maze Playground.

Bumper maze wall

The Bumper Sensor can also be pressed by walls surrounding different Playgrounds.

Playground walls


Where do I find the Pressing Bumper block?

To begin programming the Bumper Sensor, you will need to first open VEXcode VR. For more information, check out the Launch - Get Started with VEXcode VR article.

VR Main Screen

Next, locate the Sensing category in the Tool box and find the Pressing Bumper block.

Sensing category


How would I program the Bumper Sensor?

Change the Bumper Sensor

You can select the Left Bumper or Right Bumper from the drop-down menu.

Left_Right_Bumper_Block.png

Boolean blocks

The Boolean blocks report a condition as either true or false and fits inside any blocks with hexagonal (six-sided) inputs for other blocks.The Pressing Bumper Boolean block reports “true” if the bumper is pressed and “false” if the bumper is released or not pressed. For more information about Boolean blocks visit the Help or the Block Shapes and Meaning - VEXcode VR article.

The following is an example of a code that will cause the VR Robot to drive forward until it bumps into an object or wall.

Example Program

C blocks

C blocks loop the block(s) within them or check if a condition is true or false. They are shaped to attach stack blocks above, below, or inside them. The Bumper Sensor control blocks are commonly used with conditionals (C blocks), such as the if then or wait until blocks. For more information about conditional blocks found in the Control category, visit the Help or the Block Shapes and Meaning - VEXcode VR article.

In the following example, the code will cause the VR Robot to drive in a square forever.

Example Program