screen#
These commands only work with a VEX V5 Controller connected to the VEX EXP Brain.
print()#
The controller.screen.print(text, sep, precision)
method prints text on the Controller’s screen using the current cursor position.
Parameter |
Description |
---|---|
text |
The text to be printed on the controller screen. |
sep |
Optional. A string to inset between values. This must be written as a keyword argument (sep=). The default is |
precision |
Optional. The number of decimal places to display when printing simple numbers. This must be written as a keyword argument(precision=). The default is 2. |
Returns: None.
# 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()))
set_cursor()#
The controller.screen.set_cursor(row, col)
method sets the cursor position used for printing text on the Controller’s screen.
The V5 controller can display at most 3 lines of text.
Parameter |
Description |
---|---|
row |
The cursor row. 1, 2, or 3 |
col |
The cursor column. The first column is 1. |
Returns: None.
column()#
The controller.screen.column()
method returns the current column where text will be printed.
Returns: The current column.
row()#
The controller.screen.row()
method returns the current row where text will be printed.
Returns: The current row.
controller.screen.clear_screen()#
The controller.screen.clear_screen()
method clears the whole screen.
Returns: None.
controller.screen.clear_row()#
The controller.screen.clear_row(row)
method clears a screen row.
Parameter |
Description |
---|---|
row |
Optional. The row to clear, 1, 2, or 3, default is the current cursor row. |
Returns: None.
# Clear row 2.
controller.screen.clear_row(2)
controller.screen.next_row()#
The controller.screen.next_row()
method moves the cursor to the beginning of the next row.
Returns: None.