MicroPython HDC1080 Library¶
hdc1080¶
MicroPython driver for the TI HDC1080 Temperature and Humidity sensor
Author(s): Jose D. Montoya
-
class micropython_hdc1080.hdc1080.HDC1080(i2c, address: int =
0x40)[source]¶ Driver for the HDC1080 Sensor connected over I2C.
- Parameters¶
- Raises¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
HDC1080class. First you will need to import the libraries to use the sensorfrom machine import Pin, I2C from micropython_hdc1080 import hdc1080Once this is done you can define your
machine.I2Cobject and define your sensor objecti2c = I2C(1, sda=Pin(2), scl=Pin(3)) hdc1080 = hdc1080.HDC1080(i2c)Now you have access to the attributes
- property humidity_resolution : str¶
Sensor humidity_resolution
Mode
Value
hdc1080.HUM_RES_14BIT0b00hdc1080.HUM_RES_11BIT0b01hdc1080.HUM_RES_8BIT0b10
- property measurements : tuple[float, float]¶
Return Temperature in Celsius and Relative humidity in rh%