hdc1080

  • Author(s): sensebox

Implementation Notes

Hardware:

Software and Dependencies:

# * Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice # * Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register

class hdc1080.HDC1080(i2c, address=HDC1080_I2C_ADDR)

Library for the HDC1080 Temperature and Humidity Sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the HDC1080 is connected to.

  • address (int) – The I2C device address. Defaults to 0x40

Quickstart: Importing and using the HDC1080

Here is an example of using the HDC1080 class. First you will need to import the libraries to use the sensor

import board
from hdc1080.basic import HDC1080

Once this is done you can define your board.I2C object and define your sensor object

i2c = board.I2C()   # uses board.SCL and board.SDA
hdc = HDC1080(i2c)

Now you have access to the :attr:`temperature` and :attr:`humidity` attributes.
temperature = hdc.temperature
humidity = hdc.humidity