How to Configure and Program Bumper Switches in VCS

Step 1: Add two Bumper Switches to the robot configuration

  • Click, drag and drop two Bumper Switches from the list of smart devices into the user workspace.
  • Select Port A for the Bumper Switch on the right side and Port B for the switch on the left side.
  • Name the Bumper Switches as LeftBumper and RightBumper.

NOTE: A Bumper Switch v2 is a Three Wire Device.

NOTE: The configuration shown is for a V5 EDR Clawbot with two Bumper Switches on the C-Channel beam at the back of the robot. See this page for details.

Step 2: Begin a program

  • Click the Control command filter to access control commands and add a  when (STARTED)  command from the Control commands.
  • Add two  setVelocity  commands inside of the  when (STARTED)  command.
  • Set the Left Motor with a velocity of 25 percent and set the RightMotor with the same velocity.

NOTE: A  setVelocity  command is included under Settings commands.

Step 3: Add Actions commands

  • Add two spin commands below the setVelocity commands.
  • Set the first so that the Left Motor spins in reverse and the second so that the Right Motor spins in reverse.

NOTE: A  spin  command is included under Actions commands.

Step 4: Add a command so that the program waits until a condition is met

  • Add a waitUntil command from under the Control filter.
  • Add an and command from under the Operators filter, inside of the waitUntil command.
  • Insert two Bumper.pressing commands from under the Sensing filter inside of the and command.
  • Set the first  pressing   command to  RightBumper.pressing   and the second to  LeftBumper.pressing.  

Step 5: Set the commands to carry out when the condition is met

Add two stop commands from under the Actions filter.

  • Set one as the Left Motor and the other as the Right Motor.

NOTE: This program works best for stopping a V5 EDR Clawbot after it backs into a wide obstacle with a low wall or barrier.