API Reference
adafruit_sht4x
Python library for Sensirion SHT4x temperature and humidity sensors
Author(s): ladyada
Implementation Notes
Hardware:
Adafruit SHT40 Temperature & Humidity Sensor (Product ID: 4885)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_sht4x.CV
struct helper
- class adafruit_sht4x.Mode
Options for
power_mode
- class adafruit_sht4x.SHT4x(i2c_bus: I2C, address: int = 68)
A driver for the SHT4x temperature and humidity sensor.
- Parameters:
Quickstart: Importing and using the SHT4x temperature and humidity sensor
Here is an example of using the
SHT4x. First you will need to import the libraries to use the sensorimport board import adafruit_sht4x
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA sht = adafruit_sht4x.SHT4x(i2c)
You can now make some initial settings on the sensor
sht.mode = adafruit_sht4x.Mode.NOHEAT_HIGHPRECISION
Now you have access to the temperature and humidity using the
measurements. It will return a tuple with thetemperatureandrelative_humiditymeasurementstemperature, relative_humidity = sht.measurements
- property measurements: Tuple[float, float]
both
temperatureandrelative_humidity, read simultaneously