屏幕#

这些命令仅适用于连接到 VEX EXP Brain 的 VEX V5 控制器。

打印()#

The controller.screen.print(text, sep, precision) method prints text on the Controller’s screen using the current cursor position.

范围

描述

文本

要在控制器屏幕上打印的文本。

九月

Optional. A string to inset between values. This must be written as a keyword argument (sep=). The default is ” “.

精确

**可选。**打印简单数字时显示的小数位数。必须使用关键字参数 (precision=) 进行设置。默认值为 2。

**返回:**无。

# Print the number 1 on the screen at current cursor position.
controller.screen.print(1)

# Print the numbers 1, 2, 3 and 4 on the screen at current cursor.
controller.screen.print(1, 2, 3, 4, sep='-')

# Print motor1's velocity on the screen using a format string.
controller.screen.print("motor1 : % 7.2f" %(motor1.velocity()))

设置光标()#

The controller.screen.set_cursor(row, col) method sets the cursor position used for printing text on the Controller’s screen.

V5控制器最多可以显示3行文本。

范围

描述

光标所在行。1、2 或 3

科尔

光标所在的列。第一列是 1。

**返回:**无。

柱子()#

The controller.screen.column() method returns the current column where text will be printed.

**返回:**当前列。

排()#

The controller.screen.row() method returns the current row where text will be printed.

**返回:**当前行。

控制器.屏幕.清除屏幕()#

The controller.screen.clear_screen() method clears the whole screen.

**返回:**无。

控制器.屏幕.清除行()#

The controller.screen.clear_row(row) method clears a screen row.

范围

描述

**可选。**要清除的行,1、2 或 3,默认是当前光标行。

**返回:**无。

# Clear row 2.
controller.screen.clear_row(2)

控制器.屏幕.下一行()#

The controller.screen.next_row() method moves the cursor to the beginning of the next row.

**返回:**无。