Consola#
Introducción#
The VEXcode AIM Console is displayed in the Monitor window within VEXcode. It allows you to display text, receive input, and format printed data in real time.
Below is a list of all blocks:
print on console — Displays text at the current cursor position.
set cursor to next row on console — Moves the cursor to the next row.
clear console — Clears all text from the console.
ask and wait & answer — Prompts the user for input, then waits for a response to be entered in the console. The input can be used in the project.
set print precision on console — Adjusts numeric formatting for printed numbers.
set font color on console — Changes the color of printed text.
imprimir en la consola#
El bloque imprimir en consola muestra texto en la consola con el color de fuente actual.
imprimir [VEXcode] en la consola ▶
Parámetros |
Descripción |
|---|---|
valor |
El texto, número o valor de variable que se mostrará en la consola. |
flecha expansiva |
Expand the block to say and set cursor to next row to make the cursor move to the next row after this block. |
Ejemplo
cuando empezó
[Display a message in the console.]
imprimir [Hello, Robot!] en la consola ▶
Colocar el cursor en la siguiente fila de la consola#
The set cursor to next row on console block moves the cursor to the next row on the console.
Colocar el cursor en la siguiente fila de la consola
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display two lines of text.]
imprimir [Line 1] en la consola ▶
Colocar el cursor en la siguiente fila de la consola
imprimir [Line 2] en la consola ▶
borrar la consola#
The clear console block clears the console of all text.
borrar la consola
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Clear a console message after 2 seconds.]
imprimir [Hello, Robot!] en la consola ▶
esperar [2] segundos
borrar la consola
Pregunta, espera y responde#
The ask and wait and answer blocks are used together to prompt for an input from the console and then use the input in a project.
Pregunta [What's your name?] y espera
Parámetro |
Descripción |
|---|---|
inmediato |
The prompt to display in the console. |
respuesta
El bloque respuesta no tiene parámetros.
Ejemplo
cuando empezó
[Tell the robot your name.]
Pregunta [I'm AIM. What's your name?] y espera
imprimir (respuesta) en la consola ▶
Establecer la precisión de impresión en la consola#
The set print precision on console block sets the precision formatting used for displaying numbers on the console. This print precision will apply to all subsequently printed numbers.
Establezca la precisión de impresión en [0.1 v] en la consola
Parámetros |
Descripción |
|---|---|
precisión |
Establece la precisión de impresión en:
|
Ejemplo
cuando empezó
[Print 1/3 as 0.33.]
Establezca la precisión de impresión en [0.01 v] en la consola
imprimir ([1] [math_division v] [3]) en la consola ▶
establecer el color de fuente en la consola#
The set font color on console block changes the color of text displayed on the console. This affects all future printed text until the color is changed again.
Establezca el color de fuente a [rojo v] en la consola
Parámetro |
Descripción |
|---|---|
color |
The color to set:
|
Ejemplo
cuando empezó
[Display a green message.]
Establezca el color de fuente a [verde v] en la consola
imprimir [I am green!] en la consola ▶