Struct rust_rpi_4wd_car::Sensors[][src]

pub struct Sensors { /* fields omitted */ }

Simplifies working with robot’s ultrasonic, tracking, and proximity sensors.

Implementations

impl Sensors[src]

pub fn new<T: Into<Option<f32>>, H: Into<Option<f32>>>(
    temperature: T,
    humidity: H
) -> Rr4cResult<Self>
[src]

Get new sensor instance.

Arguments

  • temperature - Temperature in °C. A None value will set a default of 20°C.
  • humidity - Relative humidity as %. A None value will set a default of 40%.

pub fn ir_proximities(&self) -> (bool, bool)[src]

pub fn ldr(&self) -> (bool, bool)[src]

pub fn as_yb_postback(&mut self) -> String[src]

pub fn tracking(&self) -> (bool, bool, bool, bool)[src]

pub fn ultrasonic(&mut self) -> Option<f32>[src]

pub const ULTRASONIC_TIMEOUT: u64[src]

Timeout in nanoseconds (ns) ≈ 30 Hz

Trait Implementations

impl Debug for Sensors[src]

Auto Trait Implementations

impl !RefUnwindSafe for Sensors

impl Send for Sensors

impl Sync for Sensors

impl Unpin for Sensors

impl !UnwindSafe for Sensors

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, 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.