Looks#
Print#
Print#
The Print block is used to print values or text in the Print Console or VEX IQ Brain’s screen.
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.
Any block that returns a value can be used in the Print block.
Choose which device to use.
In this example, the robot’s current rotation will be printed to the IQ Brain.
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.
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.
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.
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.
In this example, the robot will print “Hello” on the 1st row and “world!” on the 2nd 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 IQ (2nd gen) Brain’s screen.
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)
Choose which device to use.
In this example, the print precision is set to hundredths before printing the current drivetrain heading.
Clear All Rows#
The Clear All Rows block is used to clear the entire Print Console or IQ (2nd gen) Brain’s screen.
Choose which device to clear.
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.
Clear Row#
The Clear Row block is used to clear a single row on the IQ (2nd gen) Brain’s screen.
In this example, the robot will print “VEXcode” on three different rows before deleting the “VEXcode” in the 2nd row.
Draw#
Draw Pixel#
The Draw Pixel block is used to draw a pixel on the IQ (2nd gen) Brain’s screen.
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.
Draw Line#
The Draw Line block is used to draw a line on the IQ (2nd gen) 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.
Draw Rectangle#
The Draw Rectangle block is used to draw a rectangle on the IQ (2nd gen) Brain’s screen.
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.
Draw Circle#
The Draw Circle block is used to draw a circle on the IQ (2nd gen) 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.
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.
There are two different types of fonts available on the IQ (2nd gen) Brain’s screen.
Monospace (Mono) |
Proportional (Prop) |
---|---|
|
|
Choose what font and size to use.
In this example, medium Monospace and Proportional fonts will be printed to the IQ (2nd gen) Brain’s screen.
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.
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.
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.
Select the color of the line that will be drawn.
Choose which device to use.
In this example, a rectangle with a blue outline will be drawn.
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.
Select the color of the line that will be drawn.
In this example, a circle filled with yellow will be drawn.
Touch LED#
Set Touch LED Color#
The Set Touch LED Color block is used to set the color of the VEX IQ Touch LED.
Select which Touch LED device to use.
Select which color to display.
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.
In this example, the Touch LED will be set to green at the start of the project, then turn off after 2 seconds.
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.
Choose which Touch LED to use.
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.
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.
Set Touch LED Brightness#
The Set Touch LED Brightness block is used to set the brightness level of the VEX IQ Touch LED.
Choose which Touch LED to use.
In this example, the Touch LED will turn green at 25% brightness, then after 2 seconds, the brightness will be set to 100%.
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.
Choose which Color Sensor to use.
In this example, the Color Sensor will start at 25% brightness, then after 2 seconds, the brightness will be set to 100%.