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
setVelocitycommands inside of the
- Set the Left Motor with a velocity of 25 percent and set the RightMotor with the same velocity.
setVelocity command is included under Settings commands.
Step 3: Add Actions commands
- Add two
spincommands below the
- Set the first so that the Left Motor spins in reverse and the second so that the Right Motor spins in reverse.
spin command is included under Actions commands.
Step 4: Add a command so that the program waits until a condition is met
- Add a
waitUntilcommand from under the Control filter.
- Add an
andcommand from under the Operators filter, inside of the
- Insert two
Bumper.pressingcommands from under the Sensing filter inside of the
- Set the first
RightBumper.pressingand the second to
Step 5: Set the commands to carry out when the condition is met
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.