Skip to content

Fix documentation #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions adafruit_htu21d.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HTU21D.git"

HUMIDITY = const(0xF5)
"""Constant command used to measure humidity."""
TEMPERATURE = const(0xF3)
"""Constant command used to measure temperature."""

_RESET = const(0xFE)
_WRITE_USER1 = const(0xE6)
_READ_USER1 = const(0xE7)
Expand All @@ -63,6 +66,7 @@ def _crc(data):
class HTU21D:
"""
A driver for the HTU21D-F temperature and humidity sensor.

:param i2c_bus: The I2C bus the device is connected to
:param int address: (optional) The I2C address of the device. Defaults to :const:`0x40`

Expand Down Expand Up @@ -147,6 +151,8 @@ def measurement(self, what):
This can be useful if you want to start the measurement, but don't
want the call to block until the measurement is ready -- for instance,
when you are doing other things at the same time.

:param int what: What to measure, one of (`HUMIDITY`, `TEMPERATURE`).
"""
if what not in (HUMIDITY, TEMPERATURE):
raise ValueError()
Expand Down