Skip to main content

Crate sht4x

Crate sht4x 

Source
Expand description

embedded-hal 1.0 driver for the Sensirion SHT4x family (SHT40, SHT41, SHT45) temperature & humidity sensors.

Supports both blocking and async APIs behind cargo features.

use sht4x::{Sht4x, Precision, DEFAULT_ADDRESS};
let mut sensor = Sht4x::new(i2c, delay, DEFAULT_ADDRESS);
let m = sensor.measure(Precision::High)?;
let _ = (m.temperature_celsius(), m.humidity_percent());

Modules§

commands
SHT4x command bytes and timings (see Sensirion datasheet, v7.1).

Structs§

Measurement
A temperature + humidity measurement, holding the raw 16-bit ticks reported by the sensor. Use the accessor methods to convert to engineering units.
Sht4x
SHT4x driver, generic over an I²C bus and a delay source.

Enums§

Error
Errors returned by the SHT4x driver.
HeaterDuration
Heater activation duration.
HeaterPower
Heater power level (at 3.3 V supply).
Precision
Measurement precision (repeatability) setting.

Constants§

DEFAULT_ADDRESS
Default I²C address for the SHT4x family.