Trait DhtSensor

Source
pub trait DhtSensor<HE> {
    // Required method
    fn read(&mut self) -> Result<Reading, DhtError<HE>>;
}
Expand description

A trait for reading data from the sensor

This level of indirection is useful so you can write generic code that does not assume whether a DHT11 or DHT22 sensor is being used.

Required Methods§

Source

fn read(&mut self) -> Result<Reading, DhtError<HE>>

Reads data from the sensor and returns a Reading

Implementors§

Source§

impl<HE, ID: InterruptControl, D: DelayNs, P: InputPin<Error = HE> + OutputPin<Error = HE>> DhtSensor<HE> for Dht11<HE, ID, D, P>

Source§

impl<HE, ID: InterruptControl, D: DelayNs, P: InputPin<Error = HE> + OutputPin<Error = HE>> DhtSensor<HE> for Dht22<HE, ID, D, P>