Skip to Content
VectorLib

MotorDevice

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


pub trait MotorDevice

A smart motor, as seen by LemLib through PROS.

View source

Methods

Prop

Type

move_voltage

fn move_voltage(&mut self, millivolts: i32)

motor_move_voltage: drive with a raw voltage in millivolts. Brake mode is not applied.

Parameters

Prop

Type

Returns

()

View source

brake

fn brake(&mut self, mode: BrakeMode)

motor_brake: stop using mode.

Parameters

Prop

Type

Returns

()

View source

position

fn position(&self) -> f64

motor_get_position with encoder units set to rotations. PROS_ERR_F on error.

Returns

f64

View source

tare_position

fn tare_position(&mut self)

motor_tare_position.

Returns

()

View source

gearing

fn gearing(&self) -> Option<Gearset>

motor_get_gearing. None is E_MOTOR_GEARSET_INVALID.

Returns

Option<Gearset>

View source

is_reversed

fn is_reversed(&self) -> bool

Whether the motor is reversed. PROS expresses this as a negative port number.

Returns

bool

View source