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]
T: Into<Option<f32>>,
H: Into<Option<f32>>,
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. ANone
value will set a default of 20°C. Temperatures are limited to between -40 and +65.5°C.humidity
- Relative humidity as %. ANone
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 whentrue
.
pub fn sonar_distance(&mut self) -> Option<f32>
[src]
Used to acquire ultrasonic distance measurement if available.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,