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() -> Rr4cResult<Self>[src]

Constructor which uses default values for all optional arguments.

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

Constructor with temperature and humidity options.

Arguments

The temperature and humidity values are used to increase the accuracy of ultrasonic distance measurements.

  • temperature - Temperature in °C. A None value will set a default of 20°C. Temperatures are limited to between -40 and +65.5°C.
  • humidity - Relative humidity as %. A None value will set a default of 40%.

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

Produces an Rr4c compatible postback response of sensor data.

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

Produces an Yahboom compatible postback response of sensor data.

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

Used to acquire latest infrared (IR) proximity sensors data.

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

Used to acquire latest light dependant resister (LDR) tracking sensors data.

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

Used to acquire latest line tracking sensors data.

pub fn sonar_active(&mut self, enable: bool)[src]

Enable/disable active background sonar pinging.

Arguments

  • enable -Turns on active background sonar pinging when true.

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

Used to acquire ultrasonic distance measurement if available.

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.