Using the Print Console in VEXcode IQ with Python

The Print Console allows the user to display messages, report sensor values, or to present data from VEXcode IQ 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 IQ project at a specific moment in time, thereby making a visual connection between the project and the actions of the IQ Robot.

The Print Console needs to have active communication between the VEX IQ (2nd generation) Brain and the device being used with VEXcode IQ. This can be accomplished by:

USB Connection

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and explanations to help beginners learn programming concepts related to the VEX IQ platform.

Wireless Via Controller

Diagram illustrating the VEX IQ Robotics platform components and their connections, used in Python tutorials for educational purposes in robotics.

Note: Bluetooth communication is unavailable.


How to Open the Print Console

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and explanations to help beginners learn programming concepts and apply them to their robotics projects.

The Print Console is located in the IQ Monitor Display. To open the Print Console, select the Monitor Display icon next to Help.

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and programming concepts to help educators and students learn robotics using VEXcode IQ.

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

VEX IQ Robotics platform image illustrating components and programming resources for Python tutorials, aimed at educational purposes for beginner robotics enthusiasts.

Print commands are located in the Look category of commands and are used in a VEXcode IQ 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 IQ 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

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and programming concepts to help beginners learn how to program their VEX IQ robots effectively.

Use print commands in a VEXcode IQ 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. 

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and programming concepts to assist beginners in learning robotics through VEXcode IQ.

Download the project to the IQ Robot Brain and Select "Run". See this article on downloading and running a Python project. 

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and explanations for programming VEX IQ robots, aimed at educators and beginners in robotics.

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 IQ project.

Note: Python creates a new line by default after each print command.

Screenshot of Python code tutorial for VEX IQ Robotics platform, showcasing programming examples and instructions for beginners to enhance their understanding of robotics concepts.

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.

Diagram illustrating Python programming concepts for VEX IQ Robotics, showcasing code snippets and examples relevant to beginners and educators in the context of robotics education.

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

Screenshot of Python tutorial interface for VEX IQ Robotics platform, showcasing coding examples and resources for beginners in robotics education.

You can set the color of the text being printed by using a color code with a print command in VEXcode IQ.

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.

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and programming concepts to assist beginners in learning robotics through VEXcode IQ.

Download the project to the IQ Robot Brain and Select "Run". See this article on downloading and running a Python project. 

Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and explanations for programming robots using VEXcode IQ, aimed at educators and students to enhance their robotics skills.

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 IQ project.


Clear Rows in the Print Console

Diagram illustrating the setup and components for a VEX IQ robotics project, used in the context of Python tutorials for educational purposes.

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.

Image illustrating Python programming concepts for VEX IQ Robotics, featuring code snippets and visual aids to support educators and students in learning robotics through VEXcode IQ tutorials.

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

Diagram illustrating Python programming concepts for VEX IQ Robotics, featuring code snippets and visual aids to support educational tutorials for beginners in robotics.

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.

Screenshot of Python tutorial interface for VEX IQ Robotics platform, showcasing programming examples and resources for educators and students to enhance their robotics skills.

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.

Diagram illustrating the Python programming environment for VEX IQ, showcasing key features and components to assist educators and students in learning robotics through coding.
Screenshot of a Python tutorial for VEX IQ Robotics, showcasing code examples and explanations to help beginners understand programming concepts within the VEX IQ platform.

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.

Screenshot of a Python tutorial interface for VEX IQ Robotics, showcasing code examples and programming concepts to assist educators and students in learning robotics through VEXcode IQ.
Screenshot of a Python tutorial interface for VEX IQ Robotics, displaying code examples and explanations to help beginners learn programming concepts related to building and controlling VEX IQ robots.

The data captured by the Print Console allows the user to see valuable information about project processes including IQ 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 IQ Brain (2nd gen) 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 IQ BaseBot in degrees.

Note: The project in this example uses the BaseBot (Drivetrain, 2-motor) template.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: