pi-sensors: slew the onewire delay for lossy cables

This commit is contained in:
Astro 2021-10-11 02:04:05 +02:00
parent 7cd1e77df7
commit 0bf328bf77
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ impl Sensor for DHT22 {
fn read(&mut self) -> Vec<crate::Measurement> {
let mut delay_us = |d: u16| {
// We are using here more accurate delays than in std library
spin_sleep::sleep(Duration::from_micros(d as u64));
spin_sleep::sleep(Duration::from_micros(2 * (d as u64)));
};
self.pin.switch_output();