Looks#

Print#

Print#

The Print block is used to print values or text in the Print Console or VEX IQ Brain’s screen.

A single purple block with rounded edges that reads 'print Hello' with a right-facing arrow icon on the right side.

All reporter blocks will be printed as integer (whole) numbers by default. Use the Set Print Precision block to adjust the number of decimal places printed.

All new projects begin with the screen cursor at row 1 column 1, and at row 1 on the Print Console.

By default, the Print block will remain on the same row for any subsequent print commands. By expanding the Print block to show and set cursor to next row, this will move the cursor to the next row after printing.

Important: The Print block will not print anything to the Brain screen unless it is expanded to and set cursor to next row or followed by a Next Row block.

A single purple block with rounded edges that reads 'print Hello and set cursor to next row' with an arrow icon on the right side.

Any block that returns a value can be used in the Print block.

Choose which device to use.

A notched, purple block with rounded edges that reads 'print VEXcode on Brain' with an arrow icon on the right side. A dropdown menu is open, showing the options 'Brain' and 'Console,' with 'Brain' selected.

In this example, the robot’s current rotation will be printed to the IQ Brain.

Two connected, notched blocks with rounded edges. The first block, in yellow, reads 'when started.' The second block, in purple, reads 'print drive rotation in degrees on Brain and set cursor to next row.'"

Set Cursor#

The Set Cursor block is used to set the cursor location for Print blocks on the IQ (2nd gen) Brain’s screen or Controller’s screen.

A notched block in purple that reads 'set cursor to row 1 column 1 on Brain.'"

The Set Cursor block accepts a range for row of 1 to 20 and a range for column of 1 to 80.

In this example, the robot will print the current timer value on the Brain, clear the value, and reset back to the first column and row before printing again.

A set of code blocks arranged vertically. At the top is a yellow block that reads 'when started,' followed by an orange 'forever' block that encompasses all the other blocks. Inside the loop, there is a gray comment block with the text 'Print the current timer on the Brain,' followed by a purple block that prints the timer in seconds on the Brain and sets the cursor to the next row. Below that, another gray comment block says, 'After 1 second, clear the value and reset the cursor.' The next blocks include a yellow 'wait 1 second' block, a purple 'clear all rows on Brain' block, and a final purple block that sets the cursor to row 1, column 1 on the Brain. This configuration loops continuously, displaying the timer value, waiting, clearing the screen, and resetting the cursor.

Next Row#

The Next Row block is used to set the print output cursor on the Print Console, IQ (2nd gen) Brain’s screen, or Controller’s screen to the next available row.

A notched purple coding block with the text "set cursor to next row on Brain" written in white. There is a dropdown menu on the right side labeled "Brain.

By default, all projects begin with the screen cursor at row 1 column 1. The Next Row block will move the cursor down by a single row on the screen. The Next Row block will also set the cursor’s column to position 1.

Choose which device to use.

A notched purple coding block with the text "set cursor to next row on Brain" written in white. A dropdown menu is open, showing two options: "Brain," which is selected, and "Console." The dropdown is positioned below the block and has a small triangular pointer connecting it to the block.

In this example, the robot will print “Hello” on the 1st row and “world!” on the 2nd row.

A vertical stack of notched coding blocks. The top block is a yellow "when started" block. Below it, there are three purple blocks. The first says "print Hello on Brain" with a dropdown menu labeled "Brain" and a small arrow. The second block says "set cursor to next row on Brain" with a dropdown menu. The third block says "print world! on Brain and set cursor to next row" with a dropdown menu labeled "Brain.

Set Print Precision#

The Set Print Precision block is used to set the number of digits that appear after the decimal point when printing reporter blocks on the Print Console or IQ (2nd gen) Brain’s screen.

A notched purple coding block with the text "set print precision to 0.1" written in white. There is a dropdown menu on the right side displaying "0.1.

Choose the level of precision that inserted reporter blocks will be printed to the screen.

  • Ones (1) (Default)

  • Tenths (0.1)

  • Hundredths (0.01)

  • Thousandths (0.001)

  • All Digits (0.000001)

A notched purple coding block with the text "set print precision to" followed by a dropdown menu showing the value "0.1." Below the block, an expanded dropdown menu displays options: 1, 0.1 (with a checkmark), 0.01, 0.001, and "All Digits.

Choose which device to use.

A notched purple coding block with the text "set print precision to" followed by a dropdown menu showing the value "0.1," and then the text "on" followed by another dropdown menu showing "Brain." Below the block, an expanded dropdown menu shows options: "Brain" (with a checkmark) and "Console.

In this example, the print precision is set to hundredths before printing the current drivetrain heading.

A stack of notched coding blocks starting with a yellow "when started" block at the top. Below it, there is a purple block that reads "set print precision to 0.01 on Brain" with dropdowns for "0.01" and "Brain." Below that is another purple block that reads "print drive heading in degrees on Brain and set cursor to next row," with "drive heading in degrees" in a light blue oval-shaped block and dropdowns for "Brain.

Clear All Rows#

The Clear All Rows block is used to clear the entire Print Console or IQ (2nd gen) Brain’s screen.

A notched purple coding block with the text "clear all rows on Brain" written in white. There is a dropdown menu on the right side labeled "Brain.

Choose which device to clear.

A notched purple coding block with a yellow highlight around it, containing the text "clear all rows on Brain." There is a dropdown menu on the right side labeled "Brain." Below the block, an expanded dropdown menu shows options: "Brain" (with a checkmark) and "Console.

In this example, the robot will print the current timer value on the Brain, clear the value, and reset back to the first column and row before printing again.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, an orange "forever" block contains several actions. First, a gray comment block instructs to "Print the current timer on the Brain." Following that is a purple block that reads "print timer in seconds on Brain and set cursor to next row," with "timer in seconds" in a light blue oval-shaped block and a dropdown for "Brain." Another gray comment block appears next, stating: "After 1 second, clear the value and reset the cursor." The sequence continues with an orange block that reads "wait 1 seconds" with the number "1" in a white oval. Then, there is a purple block that reads "clear all rows on Brain" with a dropdown for "Brain." Finally, the sequence ends with another purple block that reads "set cursor to row 1 column 1 on Brain," featuring a dropdown for "Brain" and "1" in white ovals for both row and column settings. The entire sequence is enclosed within the "forever" loop, as indicated by the loop arrow at the bottom of the "forever" block.

Clear Row#

The Clear Row block is used to clear a single row on the IQ (2nd gen) Brain’s screen.

A notched purple coding block with the text "clear row 1 on Brain" written in white. The number "1" is displayed in a white oval, and there is a dropdown menu on the right side labeled "Brain.

In this example, the robot will print “VEXcode” on three different rows before deleting the “VEXcode” in the 2nd row.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a gray comment block reads: "Print 'VEXcode' on the 1st, 2nd, and 3rd rows." Following this, an orange "repeat 3" block contains a purple block that reads "print VEXcode on Brain and set cursor to next row," with "VEXcode" in a white oval-shaped block and a dropdown for "Brain." Below the "repeat" block is another gray comment block that reads: "Wait 1 second before clearing the 2nd row." An orange block follows with the text "wait 1 seconds," featuring the number "1" in a white oval. Finally, the sequence ends with a purple block that reads "clear row 2 on Brain," with the number "2" in a white oval and a dropdown for "Brain.

Draw#

Draw Pixel#

The Draw Pixel block is used to draw a pixel on the IQ (2nd gen) Brain’s screen.

A notched purple coding block with the text "draw pixel 0 0 on Brain" written in white. The numbers "0" and "0" are displayed in separate white ovals, representing coordinates, and there is a dropdown menu on the right side labeled "Brain.

The Draw Pixel block requires 2 values:

  • Value 1: X Coordinate

  • Value 2: Y Coordinate

The top-left corner of the IQ (2nd gen) Brain’s screen is at coordinates (0, 0), and the bottom-right corner is at coordinates (159, 107).

The pixel color is determined by the Set Pen Color block. The default pixel color is white.

In this example, a white pixel will be printed at (80, 50) on the IQ (2nd gen) Brain’s screen.

Image of a pixel drawn on the VEX IQ Brain's screen at coordinates (80, 50) using the Draw Pixel block.

Draw Line#

The Draw Line block is used to draw a line on the IQ (2nd gen) Brain’s screen.

Image of a line drawing block for VEX IQ programming, illustrating parameters for drawing lines on the IQ Brain's screen.

The Draw Line block requires 4 values:

  • Value 1: Beginning X coordinate

  • Value 2: Beginning Y coordinate

  • Value 3: Ending X coordinate

  • Value 4: Ending Y coordinate

The top-left corner of the IQ (2nd gen) Brain’s screen is at coordinates (0, 0), and the bottom-right corner is at coordinates (159, 107).

The line color is determined by the Set Pen Color block. The default line color is white.

In this example, a white line will be drawn from the top-left corner to the bottom-right corner on the IQ (2nd gen) Brain’s screen.

Diagram illustrating the use of the Draw Line block on the IQ Brain's screen, showing coordinates for line drawing.

Draw Rectangle#

The Draw Rectangle block is used to draw a rectangle on the IQ (2nd gen) Brain’s screen.

Diagram illustrating the Draw Rectangle block for the VEX IQ Brain, showing input parameters and example coordinates.

The Draw Rectangle block requires 4 values:

  • Value 1: Beginning X coordinate

  • Value 2: Beginning Y coordinate

  • Value 3: Width of the rectangle (in pixels)

  • Value 4: Height of the rectangle (in pixels)

The top-left corner of the IQ (2nd gen) Brain’s screen is at coordinates (0, 0), and the bottom-right corner is at coordinates (159, 107).

The outside line color is determined by the Set Pen Color block. The default line color is white.

The inside fill color is determined by the Set Fill Color block. The default fill color is black.

In this example, a rectangle will be drawn with its top-left corner at (50, 50) with each side being 25 pixels in length.

Illustration of drawing a rectangle on the IQ Brain's screen with specified coordinates and dimensions.

Draw Circle#

The Draw Circle block is used to draw a circle on the IQ (2nd gen) Brain’s screen.

Icon representing the Draw Circle" block used for drawing circles on the VEX IQ Brain's screen.

The Draw Circle block requires 3 values:

  • Value 1: Center Point X

  • Value 2: Center Point Y

  • Value 3: Radius of Circle (in pixels)

The top-left corner of the IQ (2nd gen) Brain’s screen is at coordinates (0, 0), and the bottom-right corner is at coordinates (159, 107).

The outside line color is determined by the Set Pen Color block. The default line color is white.

The inside fill color is determined by the Set Fill Color block. The default fill color is black.

In this example, a circle will be drawn with its center at (80, 50) with its radius being 20 pixels.

Image showing a drawn circle on the IQ Brain�s screen with specified center and radius parameters.

Set Font#

The Set Font block is used to set the style and size of font used on the IQ (2nd gen) Brain’s screen when printing numbers or text.

Set Font block for VEX IQ Brain, allowing selection of font style and size for printed text and numbers.

There are two different types of fonts available on the IQ (2nd gen) Brain’s screen.

Monospace (Mono)

Proportional (Prop)

Set Font block interface for adjusting font style and size on the VEX IQ Brain's screen during printing.
Each character will take up the same width.

set_font_prop
Each character will takes up different size widths based on the character.

Choose what font and size to use.

Set Font block for VEX IQ Brain, illustrating options for font style and size for printed text and values.

In this example, medium Monospace and Proportional fonts will be printed to the IQ (2nd gen) Brain’s screen.

Set Font example showing medium Monospace and Proportional fonts on the VEX IQ Brain's screen for printing text.

Set Pen Width#

The Set Pen Width block is used to set the width of the outline for shapes drawn on the IQ (2nd gen) Brain’s screen.

Set Pen Width block for VEX IQ, illustrating how to adjust the width of lines drawn on the screen.

By default, all lines have a pen width of 1 pixel.

In this example, a rectangle will be drawn with a pen width of 1 pixel (the default) and a circle will be drawn with a pen width of 5 pixels.

Illustration showing the Set Pen Width block for adjusting the outline thickness of shapes on the VEX IQ Brain's screen.

Set Pen to Color#

The Set Pen to Color block is used to set the color of lines drawn on the IQ (2nd gen) Brain’s screen or the values printed to the Print Console.

Set Pen to Color block interface for VEX IQ, used to select line color for drawing on the screen.

Select the color of the line that will be drawn.

Icon representing the Set Pen to Color" block used in VEX IQ programming to choose pen color for drawing.

Choose which device to use.

Set Pen to Color block for VEX IQ, used to select line color for drawing on the screen or printing values.

In this example, a rectangle with a blue outline will be drawn.

Set Pen to Color example showing the selection of pen color for drawing shapes on the VEX IQ Brain's screen.

Set Fill Color#

The Set Fill Color block is used to set the color that fills in shapes drawn on the IQ (2nd gen) Brain’s screen.

Image of a block labeled Set Fill Color" used in VEX IQ programming to choose fill colors for drawn shapes.

Select the color of the line that will be drawn.

Icon for selecting fill color in VEX IQ programming environment, used for drawing shapes on the IQ Brain's screen.

In this example, a circle filled with yellow will be drawn.

Example of setting fill color for shapes drawn on the VEX IQ Brain's screen, showcasing color selection options.

Touch LED#

Set Touch LED Color#

The Set Touch LED Color block is used to set the color of the VEX IQ Touch LED.

A notched purple coding block with the text "set TouchLED11 color to none" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "none," which is inside a rounded, darker purple section of the block.

Select which Touch LED device to use.

A notched purple coding block with a yellow highlight around it containing the text "set TouchLED11 color to none" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "none." Below the block, an expanded dropdown menu shows the option "TouchLED11" with a checkmark next to it.

Select which color to display.

A notched purple coding block with a yellow highlight around it containing the text "set TouchLED11 color to none" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "none." Above the block, an expanded dropdown menu shows various color options, including "none" (with a checkmark), "red," "green," "blue," "white," "yellow," "orange," "purple," "red violet," "violet," and "blue violet.

You can also set the color of the Touch LED to the color detected by the Color Sensor or Optical Sensor using the Color Sensor Color Name or Optical Sensor Color Name block.

Two notched purple coding blocks are displayed. The first block reads "set TouchLED11 color to Color12 color name," with "TouchLED11" in a dropdown, "Color12" in a light blue oval-shaped dropdown, and "color name" in a lighter blue oval. The second block reads "set TouchLED11 color to Optical4 color name," with "TouchLED11" in a dropdown, "Optical4" in a light blue oval-shaped dropdown, and "color name" in a lighter blue oval.

In this example, the Touch LED will be set to green at the start of the project, then turn off after 2 seconds.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a purple block reads "set TouchLED11 color to green," with "TouchLED11" and "green" in dropdowns. Following that is an orange block that reads "wait 2 seconds," with the number "2" in a white oval. The sequence ends with another purple block that reads "set TouchLED11 color to none," with "TouchLED11" and "none" in dropdowns.

Set Touch LED Fade#

The Set Touch LED Fade block is used to set how fast the color of the VEX IQ Touch LED fades between colors.

A notched purple coding block with the text "set TouchLED11 fade to slow" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "slow.

Choose which Touch LED to use.

A notched purple coding block with a yellow highlight around it containing the text "set TouchLED11 fade to slow" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "slow." Below the block, an expanded dropdown menu shows the option "TouchLED11" with a checkmark next to it.

Choose how fast a color on the Touch LED will fade when swapped to a new color.

  • slow - The Touch LED will slowly fade to a new color.

  • fast - The Touch LED will quickly fade to a new color.

  • off - The Touch LED’s color will change instantly.

A notched purple coding block with a yellow highlight around it containing the text "set TouchLED11 fade to slow" written in white. There are two dropdown menus: one labeled "TouchLED11" and the other labeled "slow." Below the block, an expanded dropdown menu shows the options "slow" (with a checkmark), "fast," and "off.

In this example, the Touch LED will be set to green and the fade will be set to slow at the start of the project, then the Touch LED will change to red after two seconds.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a purple block reads "set TouchLED11 color to green," with "TouchLED11" and "green" in dropdowns. Following that is another purple block that reads "set TouchLED11 fade to slow," with "TouchLED11" and "slow" in dropdowns. Next, an orange block reads "wait 2 seconds," with the number "2" in a white oval. The sequence ends with a purple block that reads "set TouchLED11 color to red," with "TouchLED11" and "red" in dropdowns.

Set Touch LED Brightness#

The Set Touch LED Brightness block is used to set the brightness level of the VEX IQ Touch LED.

A notched purple coding block with the text "set TouchLED11 brightness to 50%" written in white. There are two elements: a dropdown menu labeled "TouchLED11" and the number "50" displayed in a white oval, representing the brightness level. The "%" symbol follows the number.

Choose which Touch LED to use.

A notched purple coding block with a yellow highlight around it containing the text "set TouchLED11 brightness to 50%" written in white. There are two elements: a dropdown menu labeled "TouchLED11" and the number "50" displayed in a white oval, representing the brightness level. The "%" symbol follows the number. Below the block, an expanded dropdown menu shows the option "TouchLED11" with a checkmark next to it.

In this example, the Touch LED will turn green at 25% brightness, then after 2 seconds, the brightness will be set to 100%.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a purple block reads "set TouchLED11 brightness to 25%," with "TouchLED11" in a dropdown and "25" displayed in a white oval, followed by the "%" symbol. Next, another purple block reads "set TouchLED11 color to green," with "TouchLED11" and "green" in dropdowns. Following that is an orange block that reads "wait 2 seconds," with the number "2" in a white oval. The sequence ends with a purple block that reads "set TouchLED11 brightness to 100%," with "TouchLED11" in a dropdown and "100" displayed in a white oval, followed by the "%" symbol.

Color#

Set Color Sensor Light#

The Set Color Sensor Light block is used to set the brightness of the VEX IQ Color Sensor’s light.

A notched purple coding block with the text "set Color12 light to 50%" written in white. There are two elements: a dropdown menu labeled "Color12" and the number "50" displayed in a white oval, representing the light level. The "%" symbol follows the number.

Choose which Color Sensor to use.

A notched purple coding block with a yellow highlight around it containing the text "set Color12 light to 50%" written in white. There are two elements: a dropdown menu labeled "Color12" and the number "50" displayed in a white oval, representing the light level. The "%" symbol follows the number. Below the block, an expanded dropdown menu shows the option "Color12" with a checkmark next to it.

In this example, the Color Sensor will start at 25% brightness, then after 2 seconds, the brightness will be set to 100%.

A stack of coding blocks starting with a yellow "when started" block at the top. Below it, a purple block reads "set Color12 light to 25%," with "Color12" in a dropdown and "25" displayed in a white oval, followed by the "%" symbol. Next, an orange block reads "wait 2 seconds," with the number "2" in a white oval. The sequence ends with another purple block that reads "set Color12 light to 100%," with "Color12" in a dropdown and "100" displayed in a white oval, followed by the "%" symbol.