[][src]Function dht_hal_drv::dht_split_init

pub fn dht_split_init<Error>(
    output_pin: &mut dyn OutputPin<Error = Error>,
    delay_us: &mut dyn FnMut(u16)
) -> Result<(), DhtError>

Initialize DHT sensor (sending start signal) to start readings.

Notice that there have to be about 1 sec delay before each reading (between calling dht_split_init). At this period data pin should be pulled up by resistor connected to DHT which is default connection scheme for DHT. It implies that pin should be set in input floating mode after previous reading.

In Adafruit drivers you can see that there is initial delay with high impedance for about 500-700ms. You do not need this delay if you read sensor not to often and do other logic between readings.

Arguments

  • output_pin - Output pin trait for DHT data pin.
  • delay_us - Closure where you should call appropriate delay/sleep/whatever API with microseconds as input.