Skip to main content

No project description provided

Project description

HDC1080

Discord Build Status Code Style: Black

Libray for the HDC1080 temperature and humidity sensor.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install circuitpython-hdc1080

To install system-wide (this may be required in some cases):

sudo pip3 install circuitpython-hdc1080

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install circuitpython-hdc1080

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install hdc1080

Or the following command to update an existing version:

circup update

Usage Example

import time
import board
import digitalio
from hdc1080 import HDC1080

# IO Enable Pin (only needed for senseBox MCU-S2)
io_enable_pin = digitalio.DigitalInOut(board.IO_POWER)
io_enable_pin.direction = digitalio.Direction.OUTPUT
io_enable_pin.value = False

# Initialize I2C bus
i2c = board.I2C()

# Initialize HDC1080 sensor
sensor = HDC1080(i2c)

while True:
    temperature = sensor.temperature
    humidity = sensor.humidity

    print("Temperature: {:.2f} °C".format(temperature))
    print("Humidity: {:.2f} %".format(humidity))

    time.sleep(2)  # Wait for 2 seconds before next reading

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circuitpython_hdc1080-1.0.0.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circuitpython_hdc1080-1.0.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file circuitpython_hdc1080-1.0.0.tar.gz.

File metadata

  • Download URL: circuitpython_hdc1080-1.0.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for circuitpython_hdc1080-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a5ff8ee894567cfd85e4ccef95b08a7bf8737da4df9e22959eac1caeed7ae90e
MD5 4e5a71b5f554252d13617ef3e49726c3
BLAKE2b-256 c78b0415c1e3c9ddde855093058851c2ccd018212ebee116c23f9b997d14a479

See more details on using hashes here.

File details

Details for the file circuitpython_hdc1080-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for circuitpython_hdc1080-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a53fe3633452a07de7945d3f4f098196557895de58ba591da99921cebf29c3b1
MD5 467f838d365b4e3756faab8031f22ad3
BLAKE2b-256 9071514aff96e2bb29daf4eecdb83b2ccec53b4c148b8821b9396048fc16b296

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page