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.
Select which direction for the motor to move in.
In this example, the Arm Motor will spin in the Up direction for 1 second before stopping.
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.
Select which direction for the motor to move in.
Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or 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.
In this example, the Arm Motor will spin in the Up for 200 degrees.
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.
Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or turns).
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.
In this example, the motor will spin to the 180 degrees position.
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.
In this example, the intake motors will spin in the Up for 1 second before stopping.
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 the unit of measurement to use, degrees or turns.
In this example, the Motor’s encoder position is set to 90 degrees before the motor spins to the 0 degrees position.
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.
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.
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.
In this example, the motor timeout is set to 2 seconds before it spins the motor for 3 turns in the outtake direction.
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.
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.
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.
Select when unit to use, degrees or turns.
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.
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.
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.
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.
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.
Detects color#
The Detects color block is used to report if the Front Eye Sensor detects the specified color of an object.
Select which color to detect.
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.
Brightness of#
The Brightness of block is used to report the brightness of the object detected by the Eye Sensor.
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.
Hue of#
The Hue of block is used to report the hue value of the color detected by the Eye Sensor.
The Hue of block provides a hue value between 0 to 359 degrees. This provides a more precise measurement of color.
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.
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.
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.