Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bbutner/simple-dht11

Rust library to get a data reading from a DHT11 Sensor, with a Raspberry Pi
https://github.com/bbutner/simple-dht11

dht11 raspberry-pi

Last synced: about 2 months ago
JSON representation

Rust library to get a data reading from a DHT11 Sensor, with a Raspberry Pi

Awesome Lists containing this project

README

        

# Simple DHT11

The aim of this library is to create an incredibly quick and easy way for a user to hook up a DHT11 to a Raspberry Pi and get a reading from it.

## Example

```rust
use simple_dht11::dht11::Dht11;

fn main() {
let mut dht11 = Dht11::new(27); // Note this is BCM

let response = dht11.get_reading();

println!("Temperature: {}", response.temperature);
println!("Humidity: {}", response.humidity);
}
```

Example output:

```
Temperature: 24.9
Humidity: 21
```

> ⚠️ If you are cross compiling, please see the note about this on [the RPPal Repo!](https://github.com/golemparts/rppal#cross-compilation)