overlay/pi-sensors: fix shit
This commit is contained in:
parent
cfe91aa4ae
commit
17751fdc04
|
@ -25,7 +25,7 @@ impl Sensor for DHT22 {
|
||||||
fn read(&mut self) -> Vec<crate::Measurement> {
|
fn read(&mut self) -> Vec<crate::Measurement> {
|
||||||
let mut delay_us = |d: u16| {
|
let mut delay_us = |d: u16| {
|
||||||
// We are using here more accurate delays than in std library
|
// We are using here more accurate delays than in std library
|
||||||
spin_sleep::sleep(Duration::from_micros(2 * (d as u64)));
|
spin_sleep::sleep(Duration::from_micros(d as u64));
|
||||||
};
|
};
|
||||||
|
|
||||||
self.pin.switch_output();
|
self.pin.switch_output();
|
||||||
|
@ -34,7 +34,6 @@ impl Sensor for DHT22 {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.pin.switch_input();
|
self.pin.switch_input();
|
||||||
// match dht_read(DhtType::DHT22, &mut opin, &mut delay_us) {
|
|
||||||
match dht_split_read(DhtType::DHT22, &mut self.pin, &mut delay_us) {
|
match dht_split_read(DhtType::DHT22, &mut self.pin, &mut delay_us) {
|
||||||
Ok(readings) => vec![
|
Ok(readings) => vec![
|
||||||
Measurement::new(self.location.clone(), "temperature", readings.temperature()),
|
Measurement::new(self.location.clone(), "temperature", readings.temperature()),
|
||||||
|
|
Loading…
Reference in New Issue