Print#

Print#

The Print block is used to print values or text in the Print Console, V5 Brain’s screen, or Controller’s screen.

aria-description goes here#
  print [Hello] ▶

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.

aria-description goes here#
  print [Hello] ◀ and set cursor to next row

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

Choose which device to use.

Diagram of a V5 print device showcasing printing options and screen layout for the V5 Brain and Controller.

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

Illustration of V5 Brain's screen layout showing rows and columns for printing text and adjusting font settings.

Set Cursor#

The Set Cursor block is used to set the cursor location for Print blocks on the V5 Brain’s screen or Controller’s screen.

aria-description goes here#
  set cursor to row (1) column (1) on Brain :: #9A67FF

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

Choose which device to use.

Set Cursor block for V5 Brain screen, illustrating cursor position settings for printing text.

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.

aria-description goes here#
  when started :: hat events
  forever
  [Print the current timer on the Brain.]
  print (timer in seconds) on [Brain v] ◀ and set cursor to next row
  [After 1 second, clear the value and reset the cursor.]
  wait (1) seconds
  clear all rows on [Brain v]
  set cursor to row (1) column (1) on Brain :: #9A67FF

Next Row#

The Next Row block is used to set the print output cursor on the Print Console, V5 Brain’s screen, or Controller’s screen to the next available row.

aria-description goes here#
  set cursor to next row on [Brain v]

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.

Icon representing the Next Row" block for setting the print output cursor on V5 Brain's screen or Controller's screen.

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

aria-description goes here#
  when started :: hat events
  print [Hello] on [Brain v] ▶
  set cursor to next row on [Brain v]
  print [world!] on [Brain v] ◀ and set cursor to next row

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 V5 Brain’s screen.

aria-description goes here#
  set print precision to [0.1 v]

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)

Image showing the Set Print Precision block for adjusting decimal places in V5 Brain's print output.

Choose which device to use.

Image illustrating the Set Print Precision block for adjusting decimal places in V5 Brain printing.

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

aria-description goes here#
  when started :: hat events
  set print precision to [0.1 v] on [Brain v]
  print (drive heading in degrees) on [Brain v] ◀ and set cursor to next row

Clear All Rows#

The Clear All Rows block is used to clear the entire Print Console, V5 Brain’s screen, or Controller’s screen.

aria-description goes here#
  clear all rows on[Brain v]

Choose which device to clear.

Icon representing the Clear All Rows" function for the V5 Brain's screen

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.

aria-description goes here#
  when started :: hat events
  forever
  [Print the current timer on the Brain.]
  print (timer in seconds) on [Brain v] ◀ and set cursor to next row
  [After 1 second, clear the value and reset the cursor.]
  wait (1) seconds
  clear all rows on [Brain v]
  set cursor to row (1) column (1) on Brain :: #9A67FF
  end

Clear Row#

The Clear Row block is used to clear a single row on the V5 Brain’s screen or Controller’s screen.

aria-description goes here#
  clear row (1) on Brain

Choose which device to clear the row of.

Clear Row block for V5 Brain's screen, used to clear a specific row of printed text or values.

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

aria-description goes here#
  when started :: hat events
  [Print "VEXcode" on the 1st, 2nd, and 3rd rows.]
  repeat (3)
  print [VEXcode] on [Brain v] ◀ and set cursor to next row
  end
  [Wait 1 second before clearing the 2nd row.]
  wait (1) seconds
  clear row (2) on Brain

Set Font#

The Set Font block is used to set the style and size of font used on the V5 Brain’s screen when printing numbers or text.

  set font to [Mono Medium v] on Brain

There are two different types of fonts available on the V5 Brain’s screen.

Monospace (Mono)

Proportional (Prop)

Image showing the Set Font block for selecting font style and size on the V5 Brain's screen for printing text.
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 options for V5 Brain's screen, displaying font sizes and corresponding rows and columns available.

In this example, medium Monospace and Proportional fonts will be printed to the V5 Brain’s screen.

aria-description goes here#
  when started :: hat events
  set font to [Mono Medium v] on Brain 
  print [Mono Medium] on [Brain v] ◀ and set cursor to next row
  set font to [Prop Medium v] on Brain 
  print [Prop Medium] on [Brain v] ◀ and set cursor to next row