Struct ev3dev_lang_rust::sensors::InfraredSensor[][src]

pub struct InfraredSensor { /* fields omitted */ }

LEGO EV3 infrared sensor.

Implementations

impl InfraredSensor[src]

pub fn get(port: SensorPort) -> Ev3Result<Self>[src]

Try to get a Self on the given port. Returns None if port is not used or another device is connected.

pub fn find() -> Ev3Result<Self>[src]

Try to find a Self. Only returns a motor if their is exactly one connected, Error::NotFound otherwise.

pub fn list() -> Ev3Result<Vec<Self>>[src]

Extract list of connected 'Self'

pub const MODE_IR_PROX: &'static str[src]

Proximity

pub fn set_mode_ir_prox(&self) -> Ev3Result<()>[src]

Proximity

pub fn is_mode_ir_prox(&self) -> Ev3Result<bool>[src]

Proximity

pub const MODE_IR_SEEK: &'static str[src]

IR Seeker

pub fn set_mode_ir_seek(&self) -> Ev3Result<()>[src]

IR Seeker

pub fn is_mode_ir_seek(&self) -> Ev3Result<bool>[src]

IR Seeker

pub const MODE_IR_REMOTE: &'static str[src]

IR Remote Control

pub fn set_mode_ir_remote(&self) -> Ev3Result<()>[src]

IR Remote Control

pub fn is_mode_ir_remote(&self) -> Ev3Result<bool>[src]

IR Remote Control

pub const MODE_IR_REM_A: &'static str[src]

IR Remote Control

pub fn set_mode_ir_rem_a(&self) -> Ev3Result<()>[src]

IR Remote Control

pub fn is_mode_ir_rem_a(&self) -> Ev3Result<bool>[src]

IR Remote Control

pub const MODE_IR_S_ALT: &'static str[src]

Alternate IR Seeker ???

pub fn set_mode_ir_s_alt(&self) -> Ev3Result<()>[src]

Alternate IR Seeker ???

pub fn is_mode_ir_s_alt(&self) -> Ev3Result<bool>[src]

Alternate IR Seeker ???

pub const MODE_IR_CAL: &'static str[src]

Calibration ???

pub fn set_mode_ir_cal(&self) -> Ev3Result<()>[src]

Calibration ???

pub fn is_mode_ir_cal(&self) -> Ev3Result<bool>[src]

Calibration ???

pub fn get_distance(&self) -> Ev3Result<i32>[src]

Get the proximity distance, in the range 0-100 (pct).

Trait Implementations

impl Clone for InfraredSensor[src]

impl Debug for InfraredSensor[src]

impl Device for InfraredSensor[src]

impl Sensor for InfraredSensor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.