Consola#

Introducción#

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

Acciones – Interactuar con la consola.

  • imprimir – Imprimir texto en la consola.

  • new_line – Mueve la posición del cursor de la consola al comienzo de la siguiente fila hacia abajo.

  • clear – Borra todo el texto de la consola.

Mutadores: cambian el color del texto en la consola.

  • set_print_color – Establece el color en el que se mostrará el texto en la consola.

Monitor: monitoree el valor de un sensor o una variable durante un proyecto en la pestaña Monitor de VEXcode.

Comportamiento#

print#

print prints values in the console using the current cursor position.

Usage:
console.print(value, precision)

Parámetros

Descripción

value

El valor a imprimir como una cadena o un número.

precision

Opcional. Cuántos decimales se imprimirán. El valor predeterminado es 0.

# Example coming soon

new_line#

new_line moves the cursor to the start of the row below the current position in the Console.

Usage:
console.new_line()

Parámetros

Descripción

Este método no tiene parámetros.

# Example coming soon

clear#

clear clears all text from the Console.

Usage:
console.clear()

Parámetros

Descripción

Este método no tiene parámetros.

# Example coming soon

Mutadores#

set_print_color#

set_print_color sets the color used when printing text to the Console.

Usage:
set_print_color(color)

Parámetros

Descripción

color

The color to print text with:

  • BLACK
  • BLUE
  • GREEN
  • RED
# Example coming soon

Monitor#

monitor_sensor#

monitor_sensor adds a sensor value to be monitored in the Monitor tab of VEXcode.

Usage:
monitor_sensor(“sensor”)

Parámetros

Descripción

sensor

Which sensor to monitor, given as a string:

  • Timer
    • timer.time
  • Drivetrain
    • drivetrain.get_heading
    • drivetrain.get_rotation
    • drivetrain.get_velocity
    • drivetrain.get_yaw
    • drivetrain.get_roll
    • drivetrain.get_pitch
    • drivetrain.get_crashed
    • drivetrain.is_stopped
  • Motor
    • motor.get_position
    • motor.get_velocity
    • motor.get_current
    • motor.is_stopped
    • motor.is_moving
  • Inertial
    • inertial.get_rotation
    • inertial.get_heading
    • inertial.get_yaw
    • inertial.get_roll
    • inertial.get_pitch
    • inertial.get_accelerationX
    • inertial.get_accelerationY
    • inertial.get_accelerationZ
  • Bumper
    • bumper.is_pressed
  • Eye
    • eye.get_color
    • eye.get_hue
    • eye.get_brightness
    • eye.is_object_detected
    • eye.is_color_detected

# Example coming soon

monitor_variable#

monitor_variable adds a predefined variable to be monitored in the Monitor tab of VEXcode.

Usage:
monitor_variable(“variable”)

Parámetros

Descripción

variable

El nombre de la variable predefinida a monitorear, dado como una cadena.

# Example coming soon