Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Embassy DHT Sensor Library
This Rust library provides an interface for interacting with DHT1X and DHT2X temperature and humidity sensors using the Embassy framework.
Adafruit DHT sensor library is used as a reference for this library. https://github.com/adafruit/DHT-sensor-library
Note
This library should be used in release mode. The measurements made in the debug mode are not accurate enough.
PIO support
Since version 0.2.2 this library supports PIO (Programmable Input/Output) for Raspberry Pi Pico, which allows for more accurate timing when reading data from the DHT sensors.
To enable PIO support, make sure to include the rp_pio feature in your Cargo.toml. Using PIO is recommended for better performance.
There are no requirements to run the library in release mode when using PIO.
## Supported Devices
## Getting Started
### Installation
embassy-dht-sensor` to your `Cargo.toml`:
```toml
[]
= "0.1.0"
Usage
Initialize your Raspberry Pi Pico board with Embassy. Create an instance of DHTSensor with the GPIO pin connected to your DHT sensor. Use the read method to get temperature and humidity readings.
Example using PIO (recommended):
use Instant;
use info;
use Spawner;
use ;
use PIO0;
use ;
use ;
use ;
use ;
bind_interrupts!;
async !
Example using legacy GPIO (non-PIO):
use Spawner;
use ;
use ;
use DHTSensor;
use info;
async
'''