Sensing#

To put a sensor in the Monitor Console, drag and drop its block to the Monitor Icon on the right side of the screen.

how_to_monitor

Timer#

Reset timer#

The Reset timer block is used to reset the Brain’s timer.

reset_timer_block

The Brain’s timer begins at the beginning of each project. The reset timer block is used to reset the timer back to 0 seconds.

In this example, the VR Robot will drive forward for 3 seconds before the Brain’s timer is reset and the Drivetrain stops.

reset_timer_example

Timer value#

The Timer value block is used to report the value of the Brain’s timer in seconds.

timer_block

The Brain’s timer starts at 0 seconds when the program starts and reports the timer’s value as a decimal value.

The Timer value reporter block is used inside of blocks with circular spaces.

In this example, the VR Robot will wait for 3 seconds before printing the current timer value in the Print Console.

timer_example

Drivetrain#

Drive is done#

The Drive is done block is used to report if the Drivetrain has completed its movement.

drive_done_block

The Drive is done block reports True when the Drivetrain’s motors have completed their movement.

The Drive is done block reports False when the Drivetrain’s motors are still moving.

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

In this example, the Drivetrain will drive forward for 50 inches. One second after the VR Robot has started moving, the code will begin to check if the Drivetrain has stopped. Once it is done moving, it will print its message to the Print Console.

drive_done_example

Drive is moving#

The Drive is moving block is used to report if the Drivetrain is currently moving.

drive_moving_block

The Drive is moving block reports True when the Drivetrain’s motors are moving.

The Drive is moving block reports False when the Drivetrain’s motors are stopped.

The Drive is moving block is used in blocks with hexagonal (six-sided) spaces.

In this example, the VR Robot will move forward for 50 inches. After 1 second, if the Drivetrain is still in motion, it will print a message to the Print Console.

drive_moving_example

Drive heading#

The Drive heading block is used to report the heading that the Drivetrain is facing by using the Gyroscopic (Gyro) sensor’s current angular position.

drive_heading_block

The Drive heading reporter block reports a range from 0.00 to 359.99 degrees.

The Drive heading reporter block is used inside of blocks with circular spaces.

In this example, the VR Robot’s current drive heading will be printed to the Print Console.

drive_heading_example

Drive rotation#

The Drive rotation block is used to report the Drivetrain’s angle of rotation.

drive_rotation_block

The Drive rotation reporter block reports a positive value when the Drivetrain turns in a clockwise direction.

The Drive rotation reporter block reports a negative value when the Drivetrain turns in a counter-clockwise direction.

The Drive rotation reporter block is used inside of blocks with circular spaces.

In this example, the VR Robot’s current angle of rotation will be printed to the Print Console.

drive_rotation_example

Bumper Sensor#

To identify which Bumper Sensors your VR Robot can utilize, please consult your Playground’s detail page.

Pressed bumper#

The Pressed bumper block is used to report if the Bumper Switch is pressed.

pressed_bumper_block

The Pressed bumper block reports True if the Bumper Switch is being pressed.

The Pressed bumper block reports False if the Bumper Switch is not pressed.

Choose which Bumper Switch to use.

pressed_bumper_select

The Pressing bumper Boolean block is used in blocks with hexagonal (six-sided) spaces.

In this example, the VR Robot will drive forward as it continuously checks if its Right Bumper Sensor has been pressed. If the sensor is pressed, the Drivetrain will stop.

pressed_bumper_example

Distance Sensor#

To identify which Distance Sensors your VR Robot can utilize, please consult your Playground’s detail page.

Distance found object#

The distance found object block is used to report whether the built-in Distance sensor has found an object in front of the robot.

distance_found_block

Choose which Distance Sensor to use.

The base VR Robot only has access to the Front Distance sensor.

distance_found_select_front

The VR+ Robot has access to the Front, Left, and Right Distance sensors.

distance_found_select_all

The Distance found object block reports True when the built-in Distance sensor sees an object or surface within its field of view, and within 3000 mm of the sensor.

The Distance found object block reports False when the built-in Distance sensor does not detect an object or surface within 3000 mm.

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

In this example, the VR Robot will turn right indefinitely until the Front Eye Sensor detects an object. When it detects an object, it will stop turning and print the distance between the sensor and the object in millimeters.

distance_found_example

Distance from#

The distance from block is used to report the distance of the nearest object.

distance_from_block

Choose which Distance Sensor to use.

The base VR Robot only has access to the Front Distance sensor.

distance_from_select_front

The VR+ Robot has access to the Front, Left, and Right Distance sensors.

distance_from_select_all

Choose whether the Distance from block reports in millimeters or inches.

distance_from_units

The Distance from block is used inside blocks with circular spaces.

In this example, the VR Robot will turn right indefinitely until the Front Eye Sensor detects an object. When it detects an object, it will stop turning and print the distance between the sensor and the object in millimeters.

distance_from_example

Eye Sensor#

To identify which Eye Sensors your VR Robot can utilize, please consult your Playground’s detail page.

Eye Sensor near object#

The Eye Sensor near object block is used to report if the Color Sensor Eye is close enough to an object to detect a color.

eye_near_block

Choose which Eye Sensor to use.

eye_near_select_base

The Eye Sensor near object block reports True when the Color Sensor is close to an object that has detectable colors.

The Eye Sensor near object block reports False when the Color Sensor isn’t close enough to an object with detectable colors.

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

In this example, the VR Robot will drive forward until the Front Eye Sensor is close enough to the object to detect a color, then the Drivetrain will stop.

eye_near_example

Eye Sensor detects color#

The Eye Sensor detects color block is used to report if one of the Color Sensor Eyes detects a specified color.

eye_color_block

Choose which Eye Sensor to use.

eye_color_select_base

Choose which color to detect.

eye_color_color

The Eye Sensor detects color block reports True when the Color Sensor Eye detects the selected color.

The Eye Sensor detects color block reports False when the Color Sensor Eye detects a different color than the one selected.

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

In this example, the VR Robot will drive forward until the Front Eye Sensor detects a green object. When the Front Eye Sensor detects a green object, the VR Robot will turn right for 90 degrees.

eye_color_example

Color brightness#

The Color brightness block is used to report the brightness of an object from one of the Color Sensor Eyes.

color_brightness_block

The Color brightness block reports the brightness of an object. White objects will report a brightness of 100%, black objects will report a brightness of 0%. All other colors will report a brightness between those values.

Choose which Eye Sensor to use.

color_brightness_select

The Color brightness block is used in blocks with circular spaces.

In this example, the VR Robot will drive forward until the Front Eye Sensor is close enough to detect the color of the object, then it will stop and print the object’s current brightness.

color_brightness_example

Location Sensor#

Position#

The Position block is used to report the X or Y coordinate position of the VR Robot.

position_block

Choose whether to return the X coordinate or Y coordinate.

position_select

Choose whether the value is reported in mm or inches.

position_units

The Position block is used in blocks with circular spaces.

In this example, the VR Robot’s current Y position in millimeters will be printed to the Print Console.

position_example

Position angle#

The Position angle block is used to report the angle of the VR Robot in degrees.

position_angle_block

The Position angle block is used in blocks with circular spaces.

In this example, the VR Robot’s current angle in degrees will be printed to the Print Console.

position_angle_example