Struct ev3dev_lang_rust::sensors::GyroSensor[][src]

pub struct GyroSensor { /* fields omitted */ }

LEGO EV3 gyro sensor.

Implementations

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

Angle

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

Angle

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

Angle

pub const MODE_GYRO_RATE: &'static str[src]

Rotational Speed

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

Rotational Speed

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

Rotational Speed

pub const MODE_GYRO_FAS: &'static str[src]

Raw sensor value ???

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

Raw sensor value ???

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

Raw sensor value ???

pub const MODE_GYRO_G_AND_A: &'static str[src]

Angle and Rotational Speed

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

Angle and Rotational Speed

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

Angle and Rotational Speed

pub const MODE_GYRO_CAL: &'static str[src]

Calibration ???

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

Calibration ???

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

Calibration ???

pub const MODE_TILT_RATE: &'static str[src]

Rotational Speed (2nd axis)

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

Rotational Speed (2nd axis)

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

Rotational Speed (2nd axis)

pub const MODE_TILT_ANG: &'static str[src]

Angle (2nd axis)

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

Angle (2nd axis)

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

Angle (2nd axis)

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

Gets the angle, ranging from -32768 to 32767 Fails if it has been set in the wrong mode

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

Gets the rotational speed value, ranging from -440 to 440 Fails is it has been set in the wrong mode: for example, fails if we ask for rotational speed while in MODE_GYRO_ANG mode

Trait Implementations

impl Clone for GyroSensor[src]

impl Debug for GyroSensor[src]

impl Device for GyroSensor[src]

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