Skip to content

Raspberry Pi Rust driver for the DHT11 temperature and humidity sensor

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Xavientois/rppal-dht11-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rppal-dht11-rs

crates.io badge docs.rs badge

Raspberry Pi Rust driver for the DHT11 temperature and humidity sensor, compatible with the rppal GPIO library IoPin type.

Based on this driver, but modified to work on my Raspberry Pi 4B.

Requirements

  • Rust 1.43+

Usage

Include library as a dependency in your Cargo.toml

[dependencies]
rppal-dht11 = "0.3.1"
use rppal_dht11::Dht11;
use rppal::{gpio::Gpio, hal::Delay};

let pin = Gpio::new()?.get(DHT11_PIN)?.into_output_low();
// Create an instance of the DHT11 device
let mut dht11 = Dht11::new(pin);
let mut delay = Delay::new();

// Perform a sensor reading
let measurement = dht11.perform_measurement(&mut delay).unwrap();
println!("{:?}", measurement);

License

Copyright © 2020 Pietro Lorefice

Copyright © 2022 Xavientois

Dual licensed under your choice of either of:

About

Raspberry Pi Rust driver for the DHT11 temperature and humidity sensor

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%