Skip to Content
VectorLib

ProsController

vectorlib::ProsController — fields, methods, parameters and return types.


pub struct ProsController<C: ControllerDevice = Controller>

PROS's controller functions on top of a ControllerDevice: print, clear, get_digital and get_digital_new_press with PROS's exact behaviour (31-character truncation, 0-indexed lines and columns, per-button press latches).

View source

Methods

Prop

Type

new

pub const fn new(device: C) -> Self

Wrap a controller.

Parameters

Prop

Type

Returns

Self

View source

device

pub fn device(&mut self) -> &mut C

The wrapped controller.

Returns

&mut C

View source

print

pub fn print(&mut self, line: u8, col: u8, text: &str)

controller_print(line, col, fmt, ...): text is the already-formatted string.

Parameters

Prop

Type

Returns

()

View source

clear

pub fn clear(&mut self)

controller_clear (VEXos newer than 1.0: controller_print(id, -1, 0, "")).

Returns

()

View source

get_digital

pub fn get_digital(&self, button: ControllerButton) -> bool

controller_get_digital.

Parameters

Prop

Type

Returns

bool

View source

get_digital_new_press

pub fn get_digital_new_press(&mut self, button: ControllerButton) -> bool

controller_get_digital_new_press: true the first time this is called while the button is held, false until it has been seen released by this function again.

Parameters

Prop

Type

Returns

bool

View source