The Print Console allows the user to display messages, report sensor values, or to present data from VEXcode EXP projects. The Print Console also allows users to save print outputs as a text file.
The Print Console can also be used to display process information, providing visual cues that enable the user to see what is happening in a VEXcode EXP project at a specific moment in time, thereby making a visual connection between the project and the actions of the EXP Robot.
The Print Console needs to have active communication between the VEX EXP Brain and the device being used with VEXcode EXP. This can be accomplished by:
USB Connection
Wireless Via Controller
Note: Bluetooth communication is unavailable.
How to Open the Print Console
The Print Console is located in the EXP Monitor Display. To open the Print Console, select the Monitor Display icon next to Help.
The Monitor Display will open once selected. The Print Console is at the right side.
How to Use the Print Console in a Project
Commands that Trigger the Print Console
Print commands are located in the Look category of commands and are used in a VEXcode EXP project in order to trigger the Print Console.
These commands print words, numbers, reported values from variables, values reported from a sensor or device, or clear the console.
The Help feature in VEXcode EXP provides additional information on these and other commands.
See this article for information on how to access the Help feature.
Using Print Commands with the Print Console
Use print commands in a VEXcode EXP project to print a message, or display data in the Print Console.
To use the print commands, select the command and add it to a project.
Then, type the text to be printed inside the quotation marks within the parentheses.
Note: You can also add sensor or variable commands inside the parenthesis to print data. See examples in the 'Examples using the Print Console' section.
Download the project to the EXP Robot Brain and Select "Run". See this article on downloading and running a Python project.
Once “Run” is selected, the project will run and the colored text or programmed values will be printed to the Print Console as dictated by the VEXcode EXP project.
Note: Python creates a new line by default after each print command.
You can print multiple values on a single line by adding multiple messages or commands inside the parentheses of the print command, and separating them with commas as shown on the image on the left.
Or, you can utilize the end parameter to print multiple values to a single line, as shown in this image.
Printing in Color in the Print Console
You can set the color of the text being printed by using a color code with a print command in VEXcode EXP.
To use a color code with a print command, add the escape sequence ("\033") and the color code inside the print command, as shown on the left.
The following are a few examples of color codes.
- [31m - Red
- [32m - Green
- [34m - Blue
See the complete list of color codes in the Help Feature for the print command. See this article for information on how to access the Help feature.
Download the project to the EXP Robot Brain and Select "Run". See this article on downloading and running a Python project.
Once “Run” is selected, the project will run and the colored text or programmed values will be printed to the Print Console as dictated by the VEXcode EXP project.
Clear Rows in the Print Console
There are two ways to clear all information from the Print Console. The first way to completely clear all text is to select the “Clear” button on the bottom left of the Print Console.
Another way to clear the Print Console is to use the Console Clear print command highlighted in the image on the left. Add this command to remove all of the lines in the Print Console.
In this project, “Hello” will print on the Print Console. After 3 seconds, the console will be cleared.
Save from the Print Console
It is easy to save information from the Print Console onto your device.
Select “Save” on the bottom of the Print Console to save all text as a .txt file.
Once you select the “Save” button, the file will automatically save to the Downloads folder on your device as a .txt file.
Note: The file does not save printed colors.
Example Projects Using the Print Console
Report Variable Values and Data in a Project
The Print Console can be used to report variable values at discrete moments within a project.
Use the Print Console to print the value of “myVariable."
In the project on the left, the Print Console displays variable values when the Brain buttons are pressed. The variable increases when the 'left' button is pressed, and decreases when the 'right' button is pressed.
Report Sensing Values and Data in a Project
The Print Console can be used to report sensor data at discrete moments within a project.
The data captured by the Print Console allows the user to see valuable information about project processes including EXP Robot sensor information. When the print command is triggered, it can be programmed to display information captured in the moment.
In the project on the left, the Print Console displays information reported by the Inertial Sensor built into the EXP Brain as prescribed by the Look and Sensing commands within the project. This information includes changes that the Inertial Sensor captures at discrete moments while the project is running: time in seconds and the rotation of the EXP BaseBot in degrees.
Note: The project in this example uses the BaseBot (Drivetrain, 2-motor) template.