Robot Specific Blocks#

All standard VEXcode VR Blocks are available for use in the GO Competition - Mars Math Expedition Playground.

Motion#

This Playground’s Blocks will have access to the ArmMotor parameter for all Motion blocks.

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.

Image of a VEXcode VR Spin block used for motor control in robotics programming.

Select which direction for the motor to move in.

Image illustrating the Spin block for motor control in VEXcode VR, demonstrating motor direction and operation.

In this example, the Arm Motor will spin in the Up direction for 1 second before stopping.

Diagram illustrating the VEXcode VR Spin block for motor control, demonstrating motor direction and duration settings.

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.

Image of VEXcode VR Spin block, illustrating motor spinning direction and duration for robot programming.

Select which direction for the motor to move in.

Image depicting the VEXcode VR Spin block used to control motor direction and movement duration in programming.

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

Image showing the VEXcode VR Spin for block used to control motor movement in the Mars Math Expedition Playground.

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.

Icon illustrating the Spin for" block in VEXcode VR

In this example, the Arm Motor will spin in the Up for 200 degrees.

Image illustrating the VEXcode VR Spin block, showing a motor spinning upward for 1 second before stopping.

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.

VEXcode VR Spin to Position block, demonstrating motor control for precise positioning in robot programming.

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

Image of VEXcode VR Spin to Position block, illustrating motor control for precise movement in robotics programming.

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.

Image showing VEXcode VR Spin to Position block for motor control in robotics programming.

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

Diagram illustrating the VEXcode VR Spin to Position block for motor control in robotics programming.

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_block

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

Diagram illustrating the VEXcode VR Spin block for motor control, demonstrating motor direction and duration settings.

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.

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

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

Illustration of VEXcode VR Motor Position Unit used in robot programming for motion control and motor position settings.

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

Diagram illustrating robot motor position and motion control blocks in VEXcode VR for the GO Competition.

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.

VEXcode VR Set Motor Velocity block illustration, showing motor speed adjustment for programming robot motion.

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.

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

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.

VEXcode VR Set Motor Timeout block, used to set a time limit for motor movement in programming.

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

Example of setting motor timeout in VEXcode VR for controlling motor movement duration.

Sensing#

The virtual Hero Robot has access to the standard Brain and Drivetrain Sensing Blocks.

Motor Sensing#

Motor is done#

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

VEXcode VR block showing Motor is done" status for robot motion tasks in Mars Math Expedition Playground.

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.

Example coming soon.

Motor is spinning#

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

Image of a motor spinning block from VEXcode VR, used for controlling motor movement in 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.

Example coming soon.

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.

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

Select when unit to use, degrees or turns.

Illustration of VEXcode VR Motor Position Unit used in robot programming for motion control and motor position settings.

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.

Diagram illustrating robot motor position and motion control blocks in VEXcode VR for the GO Competition.

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.

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

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

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

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

Eye Sensing#

Found object#

The Found object block is used to report if the Front Eye Sensor detects an object within approximately 40 millimeters (mm) or 1.5 inches.

found_object_block

The Found object block reports True when the Front Eye Sensor detects an object within approximately 40 millimeters (mm) or 1.5 inches.

The Found object block reports False when an object is not within approximately 40 millimeters (mm) or 1.5 inches.

The Found object block is used in blocks with hexagonal (six-sided) spaces.

In this example, the robot will check if its Front Eye Sensor has detected an object and print if it has or hasn’t detected anything.

found_object_example

Detects color#

The Detects color block is used to report if the Front Eye Sensor detects the specified color of an object.

detects_color_block

Select which color to detect.

detects_color_color

The Detects color block reports True when the Eye Sensor detects the specified color of an object.

The Detects color block reports False when the Eye Sensor does not detect the specified color of an object.

The Detects color block is used in blocks with hexagonal (six-sided) spaces.

In this example, the robot will check if its Front Eye Sensor has detected a Blue object and print if it has detected one.

detects_color_example

Brightness of#

The Brightness of block is used to report the brightness of the object detected by the Eye Sensor.

brightness_of_block

The Brightness of block is used in blocks with circular spaces.

In this example, the robot will print the current brightness of an object. Since there is no object in front of the sensor, it will print a 0.

brightness_of_example

Hue of#

The Hue of block is used to report the hue value of the color detected by the Eye Sensor.

brightness_of_block

The Hue of block provides a hue value between 0 to 359 degrees. This provides a more precise measurement of color.

color_wheel

The Hue of block is used in blocks with circular spaces.

In this example, the robot will print the current hue of an object. Since there is no object in front of the sensor, it will print a 0.

hue_of_example

Gyro Sensing#

Detected crash?#

The Detected crash? block is used to report if the robot has come in contact with a wall or other object.

Image of a VEXcode VR block labeled Detected crash?" used for reporting robot collisions in programming.

The Detected crash? block reports True if the robot comes in contact with a wall or other object.

The Detected crash? block reports False if the robot does NOT come in contact with a wall or other object.

The Detected crash? block is used in blocks with hexagonal (six-sided) spaces.

In this example, the robot will drive forward until it has crashed, then it will stop moving.

Image illustrating VEXcode VR blocks for robot motion, including Spin, Stop Motor, and Sensing features.