Motor

Trait Motor 

Source
pub trait Motor {
    // Required methods
    fn raw(&mut self, command: Command) -> Result<()>;
    fn motor_reset(&mut self, stop_action: Option<StopAction>) -> Result<()>;
    fn wait(&self, timeout: Option<Duration>) -> Result<()>;
    fn speed(&self) -> Result<Speed>;
    fn motor_angle(&self) -> Result<Distance>;
}

Required Methods§

Source

fn raw(&mut self, command: Command) -> Result<()>

Start a motor movement

Source

fn motor_reset(&mut self, stop_action: Option<StopAction>) -> Result<()>

Resets the angle of a motor to 0 this method sets the stopping action for implicit stops

Source

fn wait(&self, timeout: Option<Duration>) -> Result<()>

Waits until a motor is finished moving

Source

fn speed(&self) -> Result<Speed>

Retrieves the speed of a motor

Source

fn motor_angle(&self) -> Result<Distance>

Retrieves the angle of a motor in distance from the last reset

Trait Implementations§

Source§

impl MotorExt for dyn Motor + '_

Source§

fn dist( &mut self, dist: impl Into<Distance>, speed: impl Into<Speed>, ) -> Result<()>

Spin for a set distance (relative)
Source§

fn to_pos( &mut self, position: impl Into<Distance>, speed: impl Into<Speed>, ) -> Result<()>

Spin to a set angle (absolute) Read more
Source§

fn time(&mut self, duration: Duration, speed: impl Into<Speed>) -> Result<()>

Spin for a set time

Implementors§