2 releases
0.1.1 | May 2, 2020 |
---|---|
0.1.0 | May 2, 2020 |
#146 in #sensor
43 downloads per month
8KB
75 lines
HTU21D
Rust library for communicating with the HTU21D temperature and humidity sensor via i2c. This libray is configured with a custom build command for cargo, the library automaitcally builds for the Linux ARMV7 architecture.
This build is very much in development, there are currently no tests, no benchmarks. The library was quickly written to be able to test out the Mikro Elektronika Temp&Hum13 board. This board is a closed-source system, so no development kit was provided.
The Mikro Elektronika Temp&Hum13 board however runs a HTU21D chip on its i2c bus. Thereby allowing simple i2c communication to the sensor, bypassing the Mikro Elektronika Temp&Hum13. This library also functions using the Mikro Elekronika Pi 3 Click Shield.
For more information regarding the HTU21D datasheet follow this link.
Example
extern crate HTU21D;
extern crate linux_embedded_hal as hal;
use HTU21D::HTU21D;
use hal::I2cdev;
fn main () {
let mut dev = I2cdev::new("/dev/i2c-1").unwrap();
let driver = HTU21D::new(dev);
}
Dependencies
~2MB
~44K SLoC