[−][src]Struct stemma_soil_sensor::SoilSensor
Implementations
impl<D: DelayUs<u16>> SoilSensor<D>
[src]
pub fn init(delay: D) -> Result<Self>
[src]
Initializes the sensor
pub fn init_with_channel(delay: D, channel: I2c) -> Result<Self>
[src]
Creates an instance from a pre-set channel. Useful if you want to communicate with the sensors through a multiplexer or if your sensor for some reason is not in the standard address range or needs some additional initialization before communicating with the sensor.
This method still initializes the sensor and performs the necessary checks.
pub fn get_temp(&mut self) -> Result<f32>
[src]
Reads the temperature off the soil sensor. The temperature is in Celsius.
The temperature sensor is not high precision but should be indicate the temperature +/- 2 degrees.
pub fn get_capacitance(&mut self) -> Result<u16>
[src]
Read the value of the moisture sensor
The values ranges from 200 (very dry) to 2000 (very wet).
Errors
This method will try to read the value from the sensors 3 times before
it returns a SoilSensErr::MoistureReadErr
if no read is successful.
Auto Trait Implementations
impl<D> RefUnwindSafe for SoilSensor<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for SoilSensor<D> where
D: Send,
D: Send,
impl<D> !Sync for SoilSensor<D>
impl<D> Unpin for SoilSensor<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for SoilSensor<D> where
D: UnwindSafe,
D: UnwindSafe,
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,
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.
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>,