屏幕#

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

打印()#

controller.screen.print(text, sep, precision) 方法使用当前光标位置在控制器的屏幕上打印文本。

范围

描述

文本

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

九月

**可选。**插入值之间的字符串。必须使用关键字参数 (sep=) 的形式。默认值为 " "

精确

**可选。**打印简单数字时显示的小数位数。必须使用关键字参数 (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()))

设置光标()#

controller.screen.set_cursor(row, col) 方法设置用于在控制器屏幕上打印文本的光标位置。

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

范围

描述

光标所在行。1、2 或 3

科尔

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

**返回:**无。

柱子()#

controller.screen.column() 方法返回当前将打印文本的列。

**返回:**当前列。

排()#

controller.screen.row() 方法返回将打印文本的当前行。

**返回:**当前行。

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

controller.screen.clear_screen() 方法清除整个屏幕。

**返回:**无。

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

controller.screen.clear_row(row) 方法清除屏幕行。

范围

描述

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

**返回:**无。

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

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

controller.screen.next_row() 方法将光标移动到下一行的开头。

**返回:**无。