Variable and Sensing Values Monitoring - Tutorials - VR Blocks

Variable and sensor monitoring available in the VEXcode VR Monitor Console provides important visual cues that allow the user to see what is happening in a VEXcode VR project in real time. The Monitor Console allows users to make a visual connection between the project and the actions of the VR Robot. Monitoring sensor and variable values in the Monitor Console allows the user to view real-time reports of a specific value (or multiple values) in a project. Monitoring also helps users to visualize the flow of the project by showing blocks that may not be explicitly reported in the Playground Dashboard. 

The following article will cover:

  • How to Use the Monitor Console
  • Monitoring Sensing Values
  • Monitoring Variable Values

How to Use the Monitor Console

To open the Monitor Window and view the Monitor Console, select the Monitor icon next to the Help.

monitor icon

The Monitor Console reports Sensor and Variable values.

Monitor window

Blocks from the Sensing category in the tool box can be added and removed from the Monitor Console by selecting and deselecting the corresponding check box.

Variables can be added and removed from the Monitor Console by selecting and deselecting the corresponding box. VEXcode VR always begins with a “myVariable” variable. For information about adding a new variable and variable naming in VEXcode VR, click here.

variable selected

Lists can also be added to the Monitor Console. Before being added to the Monitor Console, lists and 2D lists must be created.

Create a list

To add an existing list or 2D list, select the “Add Lists” button.

Add list

Existing lists can be added and removed from the Monitor Console by selecting the corresponding check box. The selected list will then appear in the Monitor Console.

To remove a list from the Monitor Console, select the “Add Lists” button again and uncheck the list you want to remove.


Monitoring Sensor Values

Monitoring sensor values in the Monitor Console allows the user to view sensor data in real-time.

In the following example, the distance from is being monitored in the Monitor Console. The project directs the VR Robot to stop if the VR Robot is less than 500mm from a wall. Watch as the values of the distance from block change in the Monitor Console.

The Monitor Console can also be used to help the user visualize the flow of the project by showing blocks that may not be explicitly reported in the Playground Dashboard, such as timer in seconds.

In the following example, timer value is being reported in the Monitor Console. The VR Robot will drive forward 400mm and then wait until timer value reports back a value greater than 3 seconds. The VR Robot will then turn right 90 degrees. Without the Monitor Console, the user would be unable to visualize the exact timing of the turn right 90 degrees command.


Monitoring Variable Values

The Monitor Console can also be used to monitor variable values. The Monitor Console can provide real-time reports of a specific variable in a project.

In the following example, the “repeat” variable is used to monitor the number of times the VR Robot repeats a certain behavior. The variable monitoring on the Monitor Console can help to provide real-time feedback to understand the flow of the project. Because the two repeat loop is nested inside of a five repeat loop, the VR Robot will fully complete the inside loop for each repeat of the outer loop for a full ten repeats, as indicated by the variable monitoring.