Struct ev3dev_lang_rust::sensors::UltrasonicSensor[][src]

pub struct UltrasonicSensor { /* fields omitted */ }

LEGO EV3 ultrasonic sensor.

Implementations

impl UltrasonicSensor[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_US_DIST_CM: &'static str[src]

Continuous measurement - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

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

Continuous measurement - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

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

Continuous measurement - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

pub const MODE_US_DIST_IN: &'static str[src]

Continuous measurement - sets LEDs on, steady. Units in inches. Distance (0-1003)

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

Continuous measurement - sets LEDs on, steady. Units in inches. Distance (0-1003)

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

Continuous measurement - sets LEDs on, steady. Units in inches. Distance (0-1003)

pub const MODE_US_LISTEN: &'static str[src]

Listen - sets LEDs on, blinking. Presence (0-1) #

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

Listen - sets LEDs on, blinking. Presence (0-1) #

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

Listen - sets LEDs on, blinking. Presence (0-1) #

pub const MODE_US_SI_CM: &'static str[src]

Single measurement - LEDs on momentarily when mode is set, then off. Units in centimeters. Distance (0-2550)

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

Single measurement - LEDs on momentarily when mode is set, then off. Units in centimeters. Distance (0-2550)

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

Single measurement - LEDs on momentarily when mode is set, then off. Units in centimeters. Distance (0-2550)

pub const MODE_US_SI_IN: &'static str[src]

Single measurement - LEDs on momentarily when mode is set, then off. Units in inches. Distance (0-1003)

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

Single measurement - LEDs on momentarily when mode is set, then off. Units in inches. Distance (0-1003)

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

Single measurement - LEDs on momentarily when mode is set, then off. Units in inches. Distance (0-1003)

pub const MODE_US_DC_CM: &'static str[src]

??? - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

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

??? - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

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

??? - sets LEDs on, steady. Units in centimeters. Distance (0-2550)

pub const MODE_US_DC_IN: &'static str[src]

??? - sets LEDs on, steady. Units in inches. Distance (0-1003)

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

??? - sets LEDs on, steady. Units in inches. Distance (0-1003)

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

??? - sets LEDs on, steady. Units in inches. Distance (0-1003)

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

Measurement of the distance detected by the sensor, unscaled.

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

Measurement of the distance detected by the sensor, in centimeters.

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

Measurement of the distance detected by the sensor, in centimeters.

Trait Implementations

impl Clone for UltrasonicSensor[src]

impl Debug for UltrasonicSensor[src]

impl Device for UltrasonicSensor[src]

impl Sensor for UltrasonicSensor[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.