use anyhow::Result; use dht11_esp32::DHT11; use esp_idf_hal::prelude::Peripherals; use std::{thread, time::Duration}; use tracing::{event, Level}; fn main() -> Result<()> { esp_idf_sys::link_patches(); tracing_subscriber::fmt::init(); let peripherals = Peripherals::take().unwrap(); let mut dht11 = DHT11::new(peripherals.pins.gpio8)?; loop { event!(Level::DEBUG, "starting mesurements"); let measurement = dht11.measure()?; event!(Level::INFO, %measurement); thread::sleep(Duration::from_millis(1101)); } }