VCS Example Program - Modkit - V5 Clawbot - Claw and Arm

This example program shows how to program the V5 Clawbot to open and close its claw using Modkit.

ObjectDelivery.vex

Configuration
  • A V5 Smart Motor, on Port 3, named clawMotor.
  • A V5 Smart Motor, on Port 8, named armMotor.
  • A V5 Smart Motor, on Port 1, named leftMotor.
  • A V5 Smart Motor, on Port 10, named rightMotor. 
Program

How it works

First, the   when (STARTED)  block tells the robot to run this code when the program starts.

Then, the claw motor is set to  .setStopping.  .setStopping  is a condition in which the motor will firmly hold, or lock in to, its position.

The arm motor is also set to to  .setStopping  which will lock the arm motor in to position.

The claw motor will then  .spin(forward), causing the claw to close.

Then, the program will pause for two-tenths of a second ( .2 seconds)  to allow the motor to start spinning.

Then the claw motor will be commanded to   stop .

Then, the program will pause for  1 second.

The arm motor is set to setTimeout after 5 seconds to ensure that when the arm's motion is resisted, the motor will stop.

The arm motor will then rotate  360 degrees (lifting).

Then, the program will pause for  1 second.

The left motor and right motor will work in conjunction and rotate forward   2160 degrees (or 6 rotations).

The program will then .waituntil the motors complete the rotations and will pause for  1 second.

The arm motor will .rotate to  0 degrees, (dropping).

The program will pause for  1 second.

Then, the claw motor is set to  spin in reverse. Since spin is used, the motor will begin rotating and the program will continue immediately. Spinning in reverse causes the claw motor to open the claw jaws.

Then, the program will pause for two-tenths of a second (  .2 seconds).

Then the claw motor will  stop .

Still need help? Contact Us Contact Us