安慰#

介绍#

以下是所有方法的列表:

操作——与控制台交互。

  • print – 将文本打印到控制台。

  • new_line – 将控制台光标位置向下移动到下一行的开头。

  • clear – 清除控制台中的所有文本。

Mutators – 更改控制台中的文本颜色。

监控——在 VEXcode 的监控选项卡中监控项目期间传感器或变量的值。

行动#

print#

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

Usage:
console.print(value, precision)

参数

描述

value

要打印为字符串或数字的值。

precision

可选。指定打印的小数位数。默认值为 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()

参数

描述

该方法没有参数。

# Example coming soon

clear#

clear clears all text from the Console.

Usage:
console.clear()

参数

描述

该方法没有参数。

# Example coming soon

修改器#

set_print_color#

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

Usage:
set_print_color(color)

参数

描述

color

The color to print text with:

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

监视器#

monitor_sensor#

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

Usage:
monitor_sensor(“sensor”)

参数

描述

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”)

参数

描述

variable

要监视的预定义变量的名称,以字符串形式给出。

# Example coming soon