Pantalla#

Introducción#

La categoría Pantalla controla la pantalla táctil del V5 Brain, lo que permite que su robot muestre texto, números y gráficos, y responda a la entrada táctil.

De forma predeterminada, la fuente para imprimir en Brain es monoespaciada pequeña, que tiene 12 filas y 48 columnas.

Para dibujar, la resolución del Cerebro es de 479 x 239 píxeles.

Un diagrama de cuadrícula etiquetado de la pantalla VEX Brain que muestra filas, columnas, dimensiones de píxeles y coordenadas, con líneas rojas que delinean la cuadrícula.

A continuación se muestra una lista de todos los métodos:

Cursor Imprimir — Colocar e imprimir texto.

  • print — Prints text at the current cursor position.

  • setCursor — Sets the cursor to a specific row and column.

  • newLine — Moves the cursor to column 1 of the next row.

  • clearLine — Clears a row of text.

  • row — Returns the current cursor row.

  • column — Returns the current cursor column.

  • printAt — Prints text at specific x- and y-coordinates.

  • getStringWidth — Returns the width of a string in pixels.

  • getStringHeight — Returns the height of a string in pixels.

Mutadores: cambian la configuración de la pantalla, los colores y el comportamiento del dibujo.

  • clearScreen — Clears the screen of all drawings and text.

  • setFont — Sets the font for printed text.

  • setPenWidth — Sets the thickness for drawn shapes and lines.

  • setPenColor — Sets the color for outlines and text.

  • setFillColor — Sets the fill color for shapes and backgrounds.

  • setOrigin — Sets a new origin for printing and drawing.

Dibujar: agrega gráficos a la pantalla.

  • drawPixel — Draws a pixel at a specific x and y-position.

  • drawLine — Draws a line between two points.

  • drawRectangle — Draws a rectangle.

  • drawCircle — Draws a circle.

  • render — Updates the Brain’s screen with text and drawings only when called.

  • setClipRegion — Restricts where drawings and text can appear.

Toque: recibe información táctil desde la pantalla.

  • pressing — Returns whether the screen is being pressed.

  • xPosition — Returns the x-coordinate of the last screen event.

  • yPosition — Returns the y-coordinate of the last screen event.

Devoluciones de llamadas: responden a eventos táctiles en la pantalla.

  • pressed — Registers a function to be called when the screen is pressed.

  • released — Registers a function to be called when the screen is released.

For information on constructing a Brain to gain access to the screen methods, see Brain.

Cursor Imprimir#

print#

print displays text on the Brain’s screen at the current cursor position and font.

Usage:
Brain.Screen.print(value);

Parámetros

Descripción

value

El texto que se mostrará en pantalla. Utilice formato de cadena de C++ para imprimir variables.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display a message at the starting cursor
  Brain.Screen.print("Hello, Robot!");
}

Una captura de pantalla del V5 Brain que muestra "Hola Pantalla" impreso en la pantalla.

setCursor#

setCursor sets the cursor at a specific row and column on the Brain’s screen. How many rows and columns can comfortably fit depends on the selected font.

Monospaced fonts have characters that are all the same width, making text placement consistent. In contrast, proportional fonts vary in character width, so some letters take up more space than others. However, regardless of which type is used, setCursor positions the cursor based on row and column size, not font style. The font size can be adjusted using setFont.

Usage:
Brain.Screen.setCursor(row, col);

Parámetros

Descripción

row

La fila del cursor.

col

La columna del cursor.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display text starting at Row 3 Column 12
  Brain.Screen.setCursor(3, 12);
  Brain.Screen.print("Row 3, Column 12");
}

Una captura de pantalla del V5 Brain que muestra "Fila 3 Columna 12" impreso en la pantalla.

newLine#

newLine moves the cursor to column 1 on the next row on the Brain’s screen.

Usage:
Brain.Screen.newLine();

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display two lines of text
  Brain.Screen.print("Line 1");
  Brain.Screen.newLine();
  Brain.Screen.print("Line 2");
}

Una captura de pantalla del V5 Brain que muestra el texto "Línea 1" impreso encima de "Línea 2".

clearLine#

clearLine clears a row of drawings and text on the Brain’s screen. By default, this will clear the row that the cursor is currently on.

Default Usage:
Brain.Screen.clearLine();

Overload Usages:
Brain.Screen.clearLine(row); Brain.Screen.clearLine(row, color);

Parámetros

Descripción

row

La fila a despejar.

color

Sets the background color of the cleared row. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display text on two rows
  Brain.Screen.print("This text stays");
  Brain.Screen.newLine();
  Brain.Screen.print("This disappears");

  // Wait 3 seconds before clearing row 2
  wait(3, seconds);
  Brain.Screen.clearLine(2);
}

row#

row returns the current row where text will be printed as an integer.

Usage:
Brain.Screen.row()

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display the cursor's current row
  Brain.Screen.setCursor(3, 12);
  Brain.Screen.print(Brain.Screen.row());
}

Una captura de pantalla del V5 Brain que muestra el texto "3" en la fila 3.

column#

column returns the current column where text will be printed as an integer.

Usage:
Brain.Screen.column()

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Display the cursor's current column
  Brain.Screen.setCursor(5, 15);
  Brain.Screen.print(Brain.Screen.column());
}

Una captura de pantalla del cerebro V5 que muestra el texto "15" en la columna 15.

printAt#

printAt displays text on the Brain’s screen at specified x- and y-coordinates (in pixels) with the current font and origin.

Usage:
Brain.Screen.printAt(x, y, value);

Parámetros

Descripción

x

The x-position to print at as a keyword argument, ie: x=, referenced to the screen origin.

y

The y-position to print at as a keyword argument, ie: y=, referenced to the screen origin.

value

El texto que se imprimirá en pantalla. Utilice el formato de cadena de C++ (Logic/Custom_formatting.md) para imprimir variables.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Print the number 1 at pixel (100, 40)
  Brain.Screen.printAt(220, 120, "Center");
}

Una captura de pantalla del V5 Brain que muestra el texto "centro" en el centro de la pantalla.

getStringWidth#

getStringWidth returns the width of a string as an integer in pixels as if it was on the Brain’s screen. The width of a string changes based on the length of the string and the size of the font.

Usage:
Brain.Screen.getStringWidth(string);

Parámetros

Descripción

string

La cuerda a medir.

getStringHeight#

get_string_height returns the height of a string as an integer in pixels as if it was on the Brain’s screen. The height of a string changes based on the length of the string and the size of the font.

Usage:
Brain.Screen.getStringHeight(string);

Parámetros

Descripción

string

La cuerda a medir.

Mutadores#

clearScreen#

clearScreen clears all drawings and text from the Brain’s screen.

Default Usage:
Brain.Screen.clearScreen();

Overload Usages:
Brain.Screen.clearScreen(color);

Parámetros

Descripción

color

Sets the background color. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Clear screen after 2 seconds
  Brain.Screen.print("VEXcode");
  wait(2, seconds);
  Brain.Screen.clearScreen();
}

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Clear screen to blue after 2 seconds
  Brain.Screen.print("VEXcode");
  wait(2, seconds);
  Brain.Screen.clearScreen(blue);
}

Una captura de pantalla del V5 Brain con una pantalla azul.

setFont#

setFont sets the font used for displaying text on the Brain’s screen. This font will apply to all text printed with print or printAt. The default font at the start of a project is mono20.

Usage:
Brain.Screen.setFont(font);

Parámetro

Descripción

font

Sets the font to one of the following:

  • mono12
  • mono15
  • mono20
  • mono30
  • mono40
  • mono60
  • prop20
  • prop30
  • prop40
  • prop60
These options are shown below.

El robot serigrafió números y letras con la fuente MONO 12. Se muestra de la A a la Z. En la parte inferior de la pantalla, tiene 26 de ancho y 15 filas.
mono12

El robot serigrafió números y letras con la fuente MONO 15. Muestra AT. En la parte inferior de la pantalla, tiene 20 caracteres de ancho y 12 filas.
mono15

El robot serigrafió números y letras con la fuente MONO 20. Muestra AP. En la parte inferior de la pantalla, mide 16 de ancho y 9 filas.
mono20

El robot serigrafió números y letras con la fuente MONO 30. Muestra AK. En la parte inferior de la pantalla, mide 11 de ancho y 6 filas.
mono30

El robot serigrafió números y letras con la fuente MONO 40. Muestra AK. En la parte inferior de la pantalla, tiene 8 caracteres de ancho y 5 filas.
mono40

El robot serigrafió números y letras con la fuente MONO 60. Muestra del 1 al 6. En la parte inferior de la pantalla, consta de tres filas.
mono60

El robot serigrafió números y letras con la fuente PROP 20. Muestra AS. En la parte inferior de la pantalla, tiene 8 caracteres de ancho y 9 filas.
prop20

El robot serigrafió números y letras con la fuente PROP 30. Muestra AM. En la parte inferior de la pantalla, mide 15 de ancho y 6 filas.
prop30

El robot serigrafió números y letras con la fuente PROP 40. Muestra AM. En la parte inferior de la pantalla, mide 15 de ancho y 6 filas.
prop40

El robot serigrafió números y letras con la fuente PROP 60. Muestra del 1 al 7. En la parte inferior de la pantalla, tiene un 7 de ancho y 3 filas.
prop60

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Set the font type to mono40
  Brain.Screen.setFont(mono40);
  Brain.Screen.print("VEX");
}

Una captura de pantalla del V5 Brain que muestra el texto "VEX" en una fuente más grande que la predeterminada.

setPenWidth#

setPenWidth sets the pen width used for drawing lines and shapes.

Usage:
Brain.Screen.setPenWidth(width);

Parámetro

Descripción

width

El ancho del lápiz, expresado como un número entero en píxeles en un rango de 0 a 32.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a rectangle with a pen width of 10
  Brain.Screen.setPenWidth(10);
  Brain.Screen.drawRectangle(50, 50, 130, 60);
}

Una captura de pantalla del V5 Brain que muestra un rectángulo con bordes gruesos.

setPenColor#

setPenColor sets the pen color used for drawing lines, shapes, and text.

Usage:
Brain.Screen.setPenColor(color);

Parámetro

Descripción

color

Optional. Sets the pen color. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a rectangle with orange borders
  Brain.Screen.setPenColor(orange);
  Brain.Screen.drawRectangle(50, 50, 130, 60);
}

Una captura de pantalla del V5 Brain que muestra un rectángulo con bordes naranjas.

setFillColor#

setFillColor method sets the fill color used when shapes are drawn.

Usage:
Brain.Screen.setFillColor(color);

Parámetro

Descripción

color

Optional. Sets the fill color. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a purple rectangle
  Brain.Screen.setFillColor(purple);
  Brain.Screen.drawRectangle(50, 50, 130, 60);
}

Una captura de pantalla del V5 Brain que muestra un rectángulo relleno de color púrpura.

setOrigin#

setOrigin sets the origin used for drawing graphics on the Brain’s screen. Drawing functions consider the top left corner of the Brain’s screen as the origin. This function can move the origin to an alternate position such as the center of the Brain’s screen.

Usage:
Brain.Screen.setOrigin(x, y);

Parámetro

Descripción

x

La posición x del origen relativa a la esquina superior izquierda como un entero de 0 a 480.

y

La posición y del origen relativa a la esquina superior izquierda como un entero de 0 a 240.

Dibujar#

drawPixel#

drawPixel draws a pixel at the specified x- and y-coordinates with the current pen color.

Usage:
Brain.Screen.drawPixel(x, y);

Parámetro

Descripción

x

La coordenada x donde se dibujará el píxel, expresada como un número entero de 0 a 480.

y

La coordenada y donde se dibujará el píxel, expresada como un número entero de 0 a 240.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw the pixels marking the corners of a square
  Brain.Screen.drawPixel(250, 100);
  Brain.Screen.drawPixel(275, 100);
  Brain.Screen.drawPixel(250, 125);
  Brain.Screen.drawPixel(275, 125);
}

Una captura de pantalla del V5 Brain que muestra una variedad de píxeles que muestran las esquinas de un cuadrado.

drawLine#

drawLine draws a line from the first specified screen coordinates (x1, y1) to the second specified screen coordinates (x2, y2). It uses the current pen width and pen color.

The x- and y-coordinates use the default origin of (0, 0) unless a different origin has been set using setOrigin.

Usage:
Brain.Screen.drawLine(x1, y1, x2, y2);

Parámetro

Descripción

x1

La coordenada x inicial de la línea, expresada como un número entero entre 0 y 480.

y1

La coordenada y inicial de la línea, expresada como un número entero entre 0 y 240.

x2

La coordenada x final de la línea, expresada como un número entero entre 0 y 480.

y2

La coordenada y final de la línea, expresada como un número entero entre 0 y 240.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a line from the top left to bottom right of the screen
  Brain.Screen.drawLine(0, 0, 479, 239);
}

La pantalla muestra una delgada línea diagonal en el centro, desde la esquina superior izquierda hasta la esquina inferior derecha.

drawRectangle#

drawRectangle draws a rectangle with its top-left corner at the specified x- and y-coordinates and a size determined by the given width and height, all measured in pixels. The rectangle’s outline is drawn using the current pen width and pen color. The interior is filled with the current fill color.

The x- and y-coordinates use the default origin of (0,0) unless a different origin has been set using setOrigin.

Default Usage:
Brain.Screen.drawRectangle(x, y, width, height);

Overload Usages:
Brain.Screen.drawRectangle(x, y, width, height, color);

Parámetro

Descripción

x

La coordenada x de la esquina superior izquierda del rectángulo, expresada como un número entero de 0 a 480.

y

La coordenada y de la esquina superior izquierda del rectángulo, expresada como un número entero de 0 a 240.

width

El ancho del rectángulo, expresado como un número entero de 0 a 480.

height

La altura del rectángulo, expresada como un número entero de 0 a 240.

color

Sets the fill color. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a rectangle on the screen
  Brain.Screen.drawRectangle(50, 50, 130, 60);
}

La pantalla del robot muestra un rectángulo con un borde blanco fino en la pantalla.

drawCircle#

drawCircle draws a circle with its center at the specified x- and y-coordinates and a size determined by the given radius, all measured in pixels. The circle’s outline is drawn using the current pen width and pen color. The interior is filled with the current fill color.

The x- and y-coordinates use the default origin of (0, 0) unless a different origin has been set using setOrigin.

Usage:
Brain.Screen.drawCircle(x, y, radius);

Overload Usages:
Brain.Screen.drawCircle(x, y, radius, color);

Parámetro

Descripción

x

La coordenada x del centro del círculo, expresada como un número entero de 0 a 480.

y

La coordenada y del centro del círculo, expresada como un número entero de 0 a 240.

radius

El radio del círculo, expresado como un número entero de 0 a 240 píxeles.

color

Sets the fill color. Options include:

  • black
  • blue
  • blue_green
  • blue_violet
  • cyan
  • green
  • orange
  • purple
  • red
  • red_orange
  • red_violet
  • violet
  • white
  • yellow
  • yellow_green
  • yellow_orange
You can also specify a custom color.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Draw a circle on the screen
  Brain.Screen.drawCircle(240, 120, 40);
}

La pantalla del robot muestra un círculo con un fino borde blanco dibujado en el centro.

render#

render enables double buffering for the Brain’s screen. Once called, any drawing commands (like text, shapes, or images) will no longer appear immediately for the rest of the project. Instead, updates will only be shown when render is used again. This allows for smoother and more controlled screen updates, but means nothing will be visible until render is used.

Usage:
Brain.Screen.render();

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Render text after moving
  Brain.Screen.render();
  Brain.Screen.print("Render later...");
  Drivetrain.driveFor(forward, 100, mm);
  Drivetrain.turnFor(right, 90, degrees);
  Brain.Screen.render();
}

setClipRegion#

setClipRegion defines a rectangular area on the screen where all drawings and text will be confined. Any content outside this region will not be displayed.

Usage:
Brain.Screen.setClipRegion(x, y, width, height);

Parámetro

Descripción

x

La coordenada x de la esquina superior izquierda de la región de recorte, expresada como un entero o un valor flotante entre 0 y 480.

y

La coordenada y de la esquina superior izquierda de la región de recorte, expresada como un entero o un punto flotante entre 0 y 240.

width

El ancho de la región de recorte en píxeles, expresado como un entero o un punto flotante entre 0 y 480.

height

La altura de la región de recorte en píxeles, expresada como un entero o un punto flotante entre 0 y 240.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Restrict text and drawings to a specific region
  Brain.Screen.setClipRegion(0, 0, 120, 120);
  Brain.Screen.drawRectangle(60, 60, 100, 100, red);
  Brain.Screen.printAt(60, 60, "Cut off!");
}

La pantalla del robot muestra un rectángulo rojo recortado con un borde blanco fino y un texto que dice "CUTOF" encima del rectángulo.

Tocar#

pressing#

pressing returns whether the screen is currently being pressed (touched).

  • true — The screen is being pressed.

  • false — The screen is not being pressed.

Usage:
Brain.Screen.pressing()

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Change the screen's color after it's pressed
  while (Brain.Screen.pressing() == false) {
    wait(5, msec);
  }

  Brain.Screen.setFillColor(green);
  Brain.Screen.drawRectangle(0, 0, 479, 239);
}

int main() {
  // Display different messages after the screen is pressed
  while (!Brain.Screen.pressing()) {
    wait(5, msec);
  }
  Brain.Screen.print("First message!");
  Brain.Screen.newLine();

  // Lift finger to press the screen again
  while (Brain.Screen.pressing()) {
    wait(5, msec);
  }
  while (Brain.Screen.pressing() == false) {
    wait(5, msec);
  }
  Brain.Screen.print("Second message!");
  Brain.Screen.newLine();
}

xPosition#

xPosition returns the x-coordinate of the last screen event (press or release) as an integer between 0 and 480.

Usage:
Brain.Screen.xPosition()

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Display a circle where the screen is pressed
  while (Brain.Screen.pressing() == false) {
    wait(5, msec);
  }

  Brain.Screen.drawCircle(Brain.Screen.xPosition(), Brain.Screen.yPosition(), 20, white);
}

yPosition#

yPosition returns the y-coordinate of the last screen event (press or release) as an integer between 0 and 240.

Usage:
Brain.Screen.yPosition()

Parámetros

Descripción

Este método no tiene parámetros.

int main() {
  // Display a circle where the screen is pressed
  while (Brain.Screen.pressing() == false) {
    wait(5, msec);
  }

  Brain.Screen.drawCircle(Brain.Screen.xPosition(), Brain.Screen.yPosition(), 20, white);
}

Devoluciones de llamadas#

pressed#

pressed registers a function to be called when the Brain’s Screen is pressed.

Default Usage:
Brain.Screen.pressed(callback)

Overload Usages:
Brain.Screen.pressed(callback, arg)

Parámetros

Descripción

callback

Una función de devolución de llamada previamente definida que se llama automáticamente cuando cambia el valor del eje. La función debe coincidir con la firma de devolución de llamada requerida. Consulte Funciones de devolución de llamada para obtener más información.

arg

Opcional. Un valor definido por el usuario que se pasa a la función de devolución de llamada al llamarla. Esto permite que la función acceda a datos definidos fuera de ella.

void screenPressed() {
  Brain.Screen.print("screen pressed");
}

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Call screenPressed whenever the Brain screen is pressed
  Brain.Screen.pressed(screenPressed);
}

// arg keeps track of how many times the screen is pressed
void onScreenPressed(void* arg) {
  // Convert arg back to an int pointer
  int* count = (int*)arg;
  (*count)++;

  Brain.Screen.clearScreen();
  Brain.Screen.setCursor(1, 1);
  Brain.Screen.print("Pressed %d times", *count);
}

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Variable to track screen presses
  int pressCount = 0;

  // Register the callback and pass the address of pressCount
  // so the callback can update it each time the screen is pressed
  Brain.Screen.pressed(onScreenPressed, &pressCount);

  // Keep the project running so the callback can be triggered
  while (true) {
    wait(20, msec);
  }
}

released#

released registers a function to be called when the screen is released (touch removed).

Default Usage:
Brain.Screen.released(callback)

Overload Usages:
Brain.Screen.released(callback, arg)

Parámetros

Descripción

callback

Una función de devolución de llamada previamente definida que se llama automáticamente cuando cambia el valor del eje. La función debe coincidir con la firma de devolución de llamada requerida. Consulte Funciones de devolución de llamada para obtener más información.

arg

Opcional. Un valor definido por el usuario que se pasa a la función de devolución de llamada al llamarla. Esto permite que la función acceda a datos definidos fuera de ella.

void screenReleased() {
  Brain.Screen.print("screen released");
}

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Call screenReleased whenever the Brain screen is released
  Brain.Screen.released(screenReleased);
}

// arg keeps track of how many times the screen is released
void onScreenReleased(void* arg) {
  // Convert arg back to an int pointer
  int* count = (int*)arg;
  (*count)++;  // Increase the release count

  Brain.Screen.clearScreen();
  Brain.Screen.setCursor(1, 1);
  Brain.Screen.print("Released %d times", *count);
}

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  // Variable to track screen releases
  int releaseCount = 0;

  // Register the callback and pass the address of releaseCount
  // so the callback can update it each time the screen is released
  Brain.Screen.released(onScreenReleased, &releaseCount);
}