Moving the Arm#
This tutorial covers how to move the arm on your VEX IQ Clawbot in VEXcode IQ (2nd gen). By the end, you’ll have a project that raises the arm.
To use the arm on your VEX IQ Clawbot, first you need to configure the Clawbot in VEXcode. The easiest way to do this is to open a Clawbot template.
Go to the Devices tab, then select Select a build. If the Devices tab is not visible, see Navigating VEXcode.
Scroll down and select the Clawbot build.
The build used for this tutorial is the Drivetrain, Claw + Arm Motors version of the Clawbot.
Select Done to add this build to your project.
Select the Motion category in the toolbox to find the spin blocks.
Attach the spin motor for block to the when started block.
spin [ClawMotor v] [close v] for (90) [degrees v] ▶
By default, the block’s motor parameter is set to ClawMotor. Select the dropdown and choose ArmMotor instead, so the block controls the arm.
spin [ArmMotor v] [up v] for (90) [degrees v] ▶
Change the direction parameter to up or down, and change the distance parameter to how far you want the arm to move. This will move the arm that many degrees from its current position.
when started
spin [ArmMotor v] [up v] for (90) [degrees v] ▶
You can also change the units parameter to turns instead of degrees. One turn is equal to 360 degrees.
spin [ArmMotor v] [up v] for (1) [turns v] ▶
One tip is to use the set motor timeout block before using the spin motor for block.
set [ArmMotor v] timeout to (1) seconds
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
set [ArmMotor v] timeout to (1) seconds
spin [ArmMotor v] [up v] for (600) [degrees v] ▶