Robot Specific Blocks#

All standard VEXcode VR Blocks are available for use in the V5RC Virtual Skills - Tipping Point Playground.

Motion#

This Playground’s Blocks will have access to the IntakeMotorGroup and ArmMotorGroup parameters for all Motion blocks.

When selecting a direction for Motion blocks, intake will spin the motor group forward and outtake spins the motor group in reverse.

Spin#

The Spin block is used to spin a motor indefinitely.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

  spin [IntakeMotorGroup v] [intake v]

Select which motor to use.

Diagram of a spin motor used in VEXcode VR for robot motion control and programming blocks.

Select which direction for the motor to move in.

spin_direction

In this example, the intake motors will spin in the intake direction for 1 second before stopping.

  when started
  spin [IntakeMotorGroup v] [intake v]
  wait (1) seconds
  stop [IntakeMotorGroup v]

Spin for#

The Spin for block is used to spin a motor for a given distance.

This is can be a non-waiting or waiting block depending on if the and don’t wait option is used.

  spin [IntakeMotorGroup v] [intake v] for [90] [degrees v] ▶

Select which motor to use.

Spin for Motor block illustration demonstrating motor control in VEXcode VR for spinning motors to a specified position.

Select which direction for the motor to move in.

spin_for_direction

Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or turns).

spin_for_unit

By default, the Spin for block will block any subsequent blocks from executing until it’s finished. By expanding the Spin for block to show and don’t wait, blocks will continue to execute while the motor is moving.

  spin [IntakeMotorGroup v] [intake v] for [90] [degrees v] ◀ and don't wait

In this example, the intake motors will spin in the intake direction for 1 turn.

  when started
  spin [IntakeMotorGroup v] [intake v] for [1] [turns v] ▶

Spin to position#

The Spin to position block is used to spin a motor to a set position.

This is can be a non-waiting or waiting block depending on if the and don’t wait option is used.

  spin [IntakeMotorGroup v] to position [90] [degrees v] ▶

Select which motor to use.

Image of a motor block labeled Spin to Position" used in VEXcode VR for robot motion control.

Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or turns).

spin_to_position_unit

By default, the Spin to position block will block any subsequent blocks from executing until it’s finished. By expanding the Spin to position block to show and don’t wait, blocks will continue to execute while the motor is moving.

  spin [IntakeMotorGroup v] to position [90] [degrees v] ◀ and don't wait

In this example, the motor will spin to the 270 degrees position.

  when started
  spin [IntakeMotorGroup v] to position [270] [degrees v] ▶

Stop Motor#

The Stop Motor block is used to stop the motor from moving.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

  stop [IntakeMotorGroup v]

Select which motor to use.

Image of a Stop Motor" block used in VEXcode VR for robot programming to halt motor movement.

In this example, the intake motors will spin in the intake direction for 1 second before stopping.

  when started
  spin [IntakeMotorGroup v] [intake v]
  wait (1) seconds
  stop [IntakeMotorGroup v]

Set Motor position#

The Set Motor position block is used to set a motor’s encoder position(s) to the entered value.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

  set [IntakeMotorGroup v] position to [0] [degrees v]

Select which motor to use.

Diagram illustrating VEXcode VR Motion Blocks for controlling motor position, velocity, and sensing motor status.

Set the unit of measurement to use, degrees or turns.

set_motor_position_unit

In this example, the Motor’s encoder position is set to 90 degrees before the motor spins to the 0 degrees position.

  when started
  set [IntakeMotorGroup v] position to [90] [degrees v]
  spin [IntakeMotorGroup v] to position [0] [degrees v] ▶

Set Motor velocity#

The Set Motor velocity block is used to set the speed of a motor.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

  set [IntakeMotorGroup v] velocity to [50] [% v]

Select which motor to use.

Diagram illustrating motor velocity control in VEXcode VR for robot motion and positioning tasks.

The Set Motor velocity block will accept a range of -100% to 100%.

In this example, the Motor’s velocity is set to 75% before it spins for 1 turn in the intake direction.

  when started
  set [IntakeMotorGroup v] velocity to [75] [% v]
  spin [IntakeMotorGroup v] [intake v] for [1] [turns v] ▶

Set Motor timeout#

The Set Motor timeout block is used to set a time limit for Motor movement blocks.

This prevents motion blocks that do not reach their intended position from preventing subsequent blocks from running.

This is a non-waiting command and allows any subsequent commands to execute without delay.

  set [IntakeMotorGroup v] timeout to [1] seconds

Select which motor to use.

Diagram illustrating the Set Motor Timeout block in VEXcode VR for controlling motor movement duration.

In this example, the motor timeout is set to 2 seconds before it spins the motor for 3 turns in the outtake direction.

  when started
  set [IntakeMotorGroup v] timeout to [2] seconds
  spin [IntakeMotorGroup v] [outtake v] for [3] [turns v] ▶

Sensing#

Byte has access to the standard Brain, Drivetrain, Bumper, Distance Sensing Blocks.

Eye Sensing has been renamed to Optical Sensing to match the Front Optical Sensor.

Byte has access to Motor Sensing Blocks:

Motor is done#

The Motor is done block is used to report if the selected Motor or Motor Group has completed its movement.

  <[IntakeMotorGroup v] is done?>

Select which Motor or Motor Group to use.

Diagram illustrating VEXcode VR motion blocks for controlling motor functions in robotics.

The Motor is done block reports True when the selected Motor or Motor Group has completed its movement.

The Motor is done block reports False when the selected Motor or Motor Group has not completed its movement.

The Motor is done block is used in blocks with hexagonal (six-sided) spaces.

In this example, the Arm will be raised so the Distance Sensor can report the closest object’s distance.

  when started
  [Raise the Arm out of the way of the Front Distance Sensor.]
  spin [ArmMotorGroup v] to position [1000] [degrees v] ◀ and don't wait
  [Wait until the Arm has finished moving.]
  wait until <[ArmMotorGroup v] is done?>
  [Print the distance between the Front Distance Sensor and the closest object in front of it.]
  print ([FrontDistance v] object distance in [mm v]) ▶

Motor is spinning#

The Motor is spinning block is used to report if the selected Motor or Motor Group is moving.

  <[IntakeMotorGroup v] is spinning?>

Select which Motor or Motor Group to use.

Diagram of a spinning motor in VEXcode VR, illustrating motor control blocks for robotics programming.

The Motor is spinning block reports True when the selected Motor or Motor Group is moving.

The Motor is spinning block reports False when the selected Motor or Motor Group is not moving.

The Motor is spinning block is used in blocks with hexagonal (six-sided) spaces.

In this example, the Arm will be raised while the Intake Motor Group is still moving.

  when started
  [Take a Block into the Intake.]
  spin [IntakeMotorGroup v] [intake v] for [90] [degrees v] ◀ and don't wait
  [Execute Blocks while the Intake Motor Group is still moving.]
  while <[IntakeMotorGroup v] is spinning?>
  [Move the Arm to a position of 1000 degrees.]
  spin [ArmMotorGroup v] to position [1000] [degrees v] ◀ and don't wait
  end

Position of motor#

The Position of motor block is used to report the position of a Motor or the first motor in a Motor Group.

  ([IntakeMotorGroup v] position in [degrees v])

Select which Motor or Motor Group to use.

Diagram illustrating VEXcode VR Motion Blocks for controlling motor position, velocity, and sensing motor status.

Select when unit to use, degrees or turns.

motor_position_unit

The Position of motor block is used in blocks with circular spaces.

In this example, the robot will print the current position of the Arm Motor Group.

  when started
  print ([ArmMotorGroup v] position in [degrees v]) ▶

Velocity of motor#

The Velocity of motor block is used to report the current velocity of a Motor or the first motor in a Motor Group.

  ([IntakeMotorGroup v] velocity in [% v] :: custom-motion)

Select which Motor or Motor Group to use.

Diagram illustrating motor velocity control in VEXcode VR for robot motion and positioning tasks.

The Velocity of motor block is used in blocks with circular spaces.

In this example, the robot will print the current velocity of the Intake Motor Group.

  when started
  print ([IntakeMotorGroup v] velocity in [% v] :: custom-motion) ▶

GPS position#

The GPS position block is used to report the positional offset of the robot’s turning reference point from the center of a field.

    ([GPS v] position [X v] in [mm v])

Select either the X or Y axis offset of the robot’s turning reference point from the center of the field to report.

Diagram illustrating GPS position and heading blocks for VEXcode VR robot programming.

Select what unit to report the offset value in, millimeters (MM) or inches.

Image of a GPS position unit used in VEXcode VR for reporting robot's positional offset and heading.

The GPS position block is used in blocks with circular spaces.

In this example, the robot will print the current Y offset of the robot’s turning reference point

    when started
    print ([GPS v] position [X v] in [mm v]) ▶

GPS heading#

The GPS heading block is used to report the heading that a robot is currently facing based on a GPS Sensor’s readings from the VEX GPS Field Code.

GPS heading reports a range from 0.00 to 359.99 degrees.

    ([GPS v] heading in degrees)

The GPS heading block is used in blocks with circular spaces.

In this example, the robot will print the current GPS heading.

    when started
    print ([GPS v] heading in degrees) ▶