Robot Specific Blocks#

All standard VEXcode VR Blocks are available for use in the VIQRC Virtual Skills - Rapid Relay Playground.

Motion#

This Playground’s Blocks will have access to the Intake Motor and Catapult Group parameters for all Motion blocks.

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

For the Catapult Group, lower will spin the Catapult Group forward and release spins the Catapult 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 [IntakeMotor v] [intake v]

Select which motor to use.

The image shows a block labeled "spin," with an option selected for "IntakeMotor" and another option below labeled "CatapultGroup." The "IntakeMotor" is chosen, and this selection likely relates to configuring which motor or group of motors will perform the spinning action in the "intake" direction. The dropdown menu allows for selecting different motors or motor groups for this operation.

Select which direction for the motor to move in.

The Intake Motor can spin in the intake or outtake directions.

The image shows a block labeled "spin," with an option selected for "IntakeMotor" and another dropdown menu showing "intake" as the selected option, with "outtake" as an alternative. This setup is likely for configuring the motor to perform a spinning action in either the "intake" or "outtake" direction, depending on the user's selection. The dropdown allows the user to switch between these two directional options.

The Catapult Group can spin in the lower or release directions.

The image shows a block labeled "spin," with "CatapultGroup" selected as the motor or group of motors to control. The action selected is "lower," with an alternative option of "release" visible in the dropdown. This setup likely configures the CatapultGroup to perform a lowering action, and the dropdown allows the user to choose between lowering and releasing the catapult mechanism.

In this example, the Catapult will launch the preloaded Ball before lowering the Catapult to get ready for a new Ball.

  when started
  [Launch the preloaded Ball.]
  spin [CatapultGroup v] [release v]
  [Lower the Catapult to load a new Ball.]
  spin [CatapultGroup v] [lower 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 [IntakeMotor v] [intake v] for [90] [degrees v] ▶

Select which motor to use.

The image shows a visual coding block where the command is to "spin" a motor, with options to select between "IntakeMotor" or "CatapultGroup." The selected motor is set to "IntakeMotor," which is then instructed to perform the "intake" action for 90 degrees.

Select which direction for the motor to move in.

The Intake Motor can spin in the intake or outtake directions.

The image depicts a coding block where a motor named "IntakeMotor" is set to "spin." The direction of the spin is selected from a dropdown menu, with "intake" being the current choice, though "outtake" is also available. The motor is programmed to spin in the chosen direction for a specified duration of 90 degrees.

The Catapult Group can spin in the lower or release directions.

The image shows a coding block that is used to control a "CatapultGroup" motor. The block is set to "spin" the motor, with a dropdown menu allowing the user to select the action, either "lower" or "release," with "lower" being selected. The motor is programmed to spin in the chosen direction for a duration of 90 degrees.

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

The image depicts a coding block configured to control an "IntakeMotor" in a coding environment. The block instructs the motor to "spin" in the "intake" direction for "90" units. A dropdown menu is highlighted, showing the user is selecting the unit of measurement, with "degrees" currently selected. The dropdown also includes an option for "turns."

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 [IntakeMotor v] [intake v] for [90] [degrees v] ◀ and don't wait

In this example, the Catapult will launch the preloaded Ball before lowering the Catapult to get ready for a new Ball.

  when started
  [Launch the preloaded Ball.]
  spin [CatapultGroup v] [release v]
  [Lower the Catapult to load a new Ball.]
  spin [CatapultGroup v] [lower v] for [1350] [degrees 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 [IntakeMotor v] to position [90] [degrees v] ▶

Select which motor to use.

The image shows a coding block where the "IntakeMotor" is selected from a dropdown menu. The block is configured to spin the motor to a specific position, set at 90 degrees. The dropdown menu allows the user to select different motor groups, such as "IntakeMotor" or "CatapultGroup," to control which motor is being adjusted.

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

The image shows a coding block configured to spin the "IntakeMotor" to a specific position of 90 units. A dropdown menu is open, allowing the user to select between "degrees" and "turns" as the unit of measurement for the motor's position. The current selection is "degrees."

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 [IntakeMotor v] to position [90] [degrees v] ◀ and don't wait

In this example, the Catapult will launch the preloaded Ball before lowering the Catapult to get ready for a new Ball.

  when started
  [Launch the preloaded Ball.]
  spin [CatapultGroup v] [release v]
  [Lower the Catapult to load a new Ball.]
  spin [CatapultGroup v] to position [1260] [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 [IntakeMotor v]

Select which motor to use.

The image shows a block from a visual coding environment with the "stop" command, which stops a selected motor. The block currently has "IntakeMotor" selected, with an option to choose "CatapultGroup" from a dropdown menu.

In this example, the Intake Motor will spin for 1 second to pick up a Ball before stopping.

  when started
  [Start spinning Intake Motor to prepare to pick up a Ball.]
  spin [IntakeMotor v] [intake v]
  wait (1) seconds
  [After the Ball is picked up, stop spinning the Intake Motor.]
  stop [IntakeMotor 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 [IntakeMotor v] position to [0] [degrees v]

Select which motor to use.

The image shows a visual coding block where the "IntakeMotor" is being set to a position of 0 degrees. The dropdown menu is open, displaying "IntakeMotor" as the selected motor, with "CatapultGroup" as an alternative option. The block is highlighted with a yellow outline, and the number "0" is set as the position value in the white oval input field.

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

The image displays a visual coding block where the "IntakeMotor" is being set to a position of 0 degrees. The dropdown menu for the unit of measurement is open, showing "degrees" as the selected option, with "turns" as an alternative option. The number "0" is set as the position value in the white oval input field.

In this example, the lowered Catapult Arm is set as the new 0 degrees position.

  when started
  [release the preloaded Ball.]
  spin [CatapultGroup v] [release v]
  [Lower the Catapult Arm to prepare for the next Ball.]
  spin [CatapultGroup v] to position [1260] [degrees v] ▶
  [Make the lowered Catapult Arm position the new 0 degrees position.]
  set [CatapultGroup v] position to [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 [IntakeMotor v] velocity to [50] [% v]

Select which motor to use.

The image shows a visual coding block that sets the velocity of a motor. The selected motor is "IntakeMotor," with an option to choose "CatapultGroup" from a drop-down menu. The velocity is set to 50%, and the unit is indicated as a percentage ("%"). The block is highlighted, indicating that the user is currently interacting with the drop-down menu to select the motor.

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

In this example, the Intake Motor’s velocity is set to 100% before the Intake Motor starts spinning to pick up Balls.

  when started
  [Start spinning the Intake Motor to prepare to pick up Balls.]
  set [IntakeMotor v] velocity to [100] [% v]
  spin [IntakeMotor v] [intake 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 [IntakeMotor v] timeout to [1] seconds

Select which motor to use.

The image depicts a block used to set a timeout for the "IntakeMotor" to 1 second, with a dropdown menu showing "IntakeMotor" as the selected motor and "CatapultGroup" as another available option.

In this example, the Catapult Group’s timeout is set to 2 seconds before it starts lowering the Catapult Arm.

  when started
  set [CatapultGroup v] timeout to [2] seconds
  [Lower Catapult Arm to prepare to pick up a Ball.]
  spin [CatapultGroup v] [lower v] for [10] [turns v] ▶

Sensing#

Swish has access to the standard Timer, Drivetrain, and Distance Sensing Blocks.

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

Swish 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.

  <[IntakeMotor v] is done?>

Select which Motor or Motor Group to use.

The image shows a block that checks if the "IntakeMotor" is done with its operation. A dropdown menu is visible, allowing the user to select either "IntakeMotor" or "CatapultGroup" to check the completion status of the selected motor or group. The "IntakeMotor" is currently selected in the dropdown.

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.

Motor is spinning#

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

  <[IntakeMotor v] is spinning?>

Select which Motor or Motor Group to use.

The image shows a block that checks if the "IntakeMotor" is spinning. There is a dropdown menu open, displaying the option to select between "IntakeMotor" and "CatapultGroup," with "IntakeMotor" currently selected.

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.

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.

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

Select which Motor or Motor Group to use.

The image shows a block that represents a command for querying the position of the "IntakeMotor" in degrees. The dropdown menu for selecting the motor is expanded, showing "IntakeMotor" selected and "CatapultGroup" as another option. The "position in" and "degrees" fields are also visible.

Select when unit to use, degrees or turns.

The image displays a command block that queries the position of the "IntakeMotor" in either degrees or turns. The dropdown menu for selecting the unit of measurement is expanded, showing "degrees" as the selected option, with "turns" as another available choice.

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

In this example, the Catapult Arm will lower until its motor position is greater than 1260 degrees.

  when started
  [Release the preloaded Ball.]
  spin [CatapultGroup v] [release v]
  [Lower the Catapult Arm to prepare for the next Ball.]
  spin [CatapultGroup v] [lower v]
  wait until <[1260] [math_less_than v] ([CatapultGroup v] position in [degrees v])>
  stop [CatapultGroup 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.

  ([IntakeMotor v] velocity in [degrees v] :: custom-motion)

Select which Motor or Motor Group to use.

The image shows a block that retrieves the velocity of the "IntakeMotor" in percent (%). The block is light blue and rounded, indicating its use for reporting a value. A dropdown menu is visible, showing "IntakeMotor" as the selected option, with "CatapultGroup" as an alternative option, allowing the user to choose which motor's velocity to retrieve.

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