Opening the Claw#

To use the claw on your VEX V5 Clawbot, first you need to configure the Clawbot in VEXcode. The easiest way to do this is to open a Clawbot template.

Configure the Clawbot#

Select a Build#

Go to the Devices tab, then select Select a build.

Screenshot of the Devices tab, showing the Select a build button.

Select the Clawbot Build#

Select the Clawbot build.

Screenshot of the Select a build screen, with the Clawbot build highlighted among other robot builds.

Choose the Drivetrain Variant#

The build used for this tutorial is the Drivetrain, Inertial version of the Clawbot, which includes both a Claw and an Arm motor.

Screenshot of the Choose a variant for Clawbot screen, with the Drivetrain, Inertial variant highlighted among the Drivetrain, 3-Wire Gyro, Drivetrain, No Gyro, and Individual Motors options.

Confirm the Configuration#

Select Done to add this build to your project.

Screenshot of the Current Configuration screen for the Clawbot, Drivetrain, Inertial build, showing the Drivetrain, ClawMotor, and ArmMotor devices, with the Done button highlighted.

Code the Claw#

Open the Motion Category#

Select the Motion category in the toolbox to find the spin blocks.

Screenshot of the toolbox with the Motion category open, showing the spin ArmMotor blocks.

Attach the Spin Block#

Attach the spin motor for block to the when started block.

The spin motor for block, spinning the ArmMotor by default.#
girar [ArmMotor v] [arriba v] por (90) [grados v] ▶

Select the ClawMotor#

By default, the block’s motor parameter is set to ArmMotor. Select the dropdown and choose ClawMotor instead, so the block controls the claw.

The spin motor for block, now spinning the ClawMotor.#
girar [ClawMotor v] [cerca v] por (90) [grados v] ▶

Open the Claw#

Change the direction parameter to open instead of close, and change the distance parameter to 60. This will open the robot’s claw 60 degrees from its current position.

When started, opens the claw 60 degrees from its current position.#
cuando inicie
girar [ClawMotor v] [abierto v] por (60) [grados v] ▶

You can also change the units parameter to turns instead of degrees. One turn is equal to 360 degrees.

The spin motor for block, using turns instead of degrees.#
girar [ClawMotor v] [abierto v] por (1) [vueltas v] ▶

Using Motor Timeouts#

One tip is to use the set motor timeout block before using the spin motor for block.

The set motor timeout block.#
establecer tiempo límite de [ClawMotor v] a (1) segundos

If you accidentally set the spin motor for block to too great of a distance, the set motor timeout block will force it to end, and the project to move on, even if the motor hasn’t reached the position it wanted to.

When started, sets a 1 second timeout before opening the claw, so the project moves on even if the claw doesn’t reach its target position.#
cuando inicie
establecer tiempo límite de [ClawMotor v] a (1) segundos
girar [ClawMotor v] [abierto v] por (600) [grados v] ▶