- Notifications
You must be signed in to change notification settings - Fork9
Python library for SHT4x temperature / humidity sensors
License
adafruit/Adafruit_CircuitPython_SHT4x
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Python library for Sensirion SHT4x temperature and humidity sensors
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem.This is easily achieved by downloadingthe Adafruit library and driver bundle.
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfromPyPI. To install for current user:
pip3 install adafruit-circuitpython-sht4x
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-sht4x
To install in a virtual environment in your current project:
mkdir project-name&&cd project-namepython3 -m venv .venvsource .venv/bin/activatepip3 install adafruit-circuitpython-sht4x
importtimeimportboardimportadafruit_sht4xi2c=board.I2C()# uses board.SCL and board.SDAsht=adafruit_sht4x.SHT4x(i2c)print("Found SHT4x with serial number",hex(sht.serial_number))sht.mode=adafruit_sht4x.Mode.NOHEAT_HIGHPRECISION# Can also set the mode to enable heater# sht.mode = adafruit_sht4x.Mode.LOWHEAT_100MSprint("Current mode is: ",adafruit_sht4x.Mode.string[sht.mode])whileTrue:temperature,relative_humidity=sht.measurementsprint("Temperature: %0.1f C"%temperature)print("Humidity: %0.1f %%"%relative_humidity)print("")time.sleep(1)
API documentation for this library can be found onRead the Docs.
For information on building library documentation, please check outthis guide.
Contributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
About
Python library for SHT4x temperature / humidity sensors
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.