Console#

Introduction#

The IQ (2nd gen) Console appears in the Monitor window and displays text output from your project. In other environments like VS Code, printf will display text on the terminal. New projects begin with the cursor at row 1.

Below is a list of all available methods:

Actions – Output text or clear the console.

Actions#

printf#

printf prints text on the screen using the current cursor position.

Note: Text will not be sent to the console until a new line is started.

Usage:
printf(value)

Parameters

Description

value

The string (in quotations) or integers to print to the Print Console.

// Print a message to the console
printf("Hello, robot!");
printf("\n");

Clear Print Console#

By using \033[2J inside of the printf command, you can clear the entire Print Console.

Usage:
printf("\033[2J\n")

// Print to the console, then clear it after
// 2 seconds
printf("VEXcode");
wait(2, seconds);
printf("\033[2J\n");