-
Notifications
You must be signed in to change notification settings - Fork 1
docs: Harmonize wsen-hids README — add I2C address and power sections. #209
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
Changes from all commits
b16e95e
1b5e7a8
956cfac
4f13299
3cd5c6c
6b4c223
6455bcb
000f9ac
169169a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,26 +39,19 @@ Main characteristics: | |||||||||
| | Humidity accuracy | ±1.8 %RH | | ||||||||||
| | Temperature accuracy | ±0.2 °C | | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| # Quick Example | ||||||||||
|
|
||||||||||
| ```python | ||||||||||
| from machine import I2C, Pin | ||||||||||
| from machine import I2C | ||||||||||
| from time import sleep | ||||||||||
| from wsen_hids import WSEN_HIDS | ||||||||||
|
|
||||||||||
| i2c = I2C( | ||||||||||
| 0, | ||||||||||
| scl=Pin(9), | ||||||||||
| sda=Pin(8), | ||||||||||
| freq=100000, | ||||||||||
| ) | ||||||||||
| i2c = I2C(1) | ||||||||||
|
|
||||||||||
| sensor = WSEN_HIDS(i2c) | ||||||||||
|
|
||||||||||
| while True: | ||||||||||
| humidity, temperature = sensor.read_one_shot() | ||||||||||
| humidity, temperature = sensor.read() | ||||||||||
|
|
||||||||||
| print("Humidity: {:.2f} %RH".format(humidity)) | ||||||||||
| print("Temperature: {:.2f} °C".format(temperature)) | ||||||||||
|
|
@@ -87,6 +80,27 @@ sensor = WSEN_HIDS( | |||||||||
| ) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### `device_id()` | ||||||||||
|
|
||||||||||
| Read the device identification register. | ||||||||||
|
|
||||||||||
| ```python | ||||||||||
| sensor.device_id() | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| **Returns:** `int` — Device ID (`WHO_AM_I` register value) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| ### `enable_bdu(enable=True)` | ||||||||||
|
|
||||||||||
| Enable or disable Block Data Update (BDU). | ||||||||||
|
|
||||||||||
| ```python | ||||||||||
| sensor.enable_bdu(enable=True) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| When enabled, output registers are not updated until both high and low bytes are read. Recommended to avoid reading inconsistent data. | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| # Reading Measurements | ||||||||||
|
|
@@ -113,21 +127,27 @@ temperature = sensor.temperature() | |||||||||
|
|
||||||||||
| ### Measurement behavior | ||||||||||
|
|
||||||||||
| After initialization, the sensor operates in **one-shot mode** (ODR = 00). | ||||||||||
| After initialization, the sensor operates in **one-shot mode** (ODR = 00). | ||||||||||
| If `read()`, `humidity()`, or `temperature()` are called while the sensor is not in continuous mode, the driver **automatically triggers a one-shot conversion** to ensure fresh data is returned. | ||||||||||
|
Comment on lines
+130
to
131
|
||||||||||
| After initialization, the sensor operates in **one-shot mode** (ODR = 00). | |
| If `read()`, `humidity()`, or `temperature()` are called while the sensor is not in continuous mode, the driver **automatically triggers a one-shot conversion** to ensure fresh data is returned. | |
| After initialization, the sensor is left in its default **power-down** state with one-shot operation configured (ODR = 00). | |
| When `read()`, `humidity()`, or `temperature()` are called and the sensor is in power-down mode, the driver **automatically triggers a one-shot conversion** and waits for fresh data before returning. |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “Available output data rates” list omits WSEN_HIDS.ODR_ONE_SHOT even though the driver exposes it as a constant. Either include it in the list or clarify that one-shot is configured via set_one_shot_mode()/read_one_shot() rather than via the ODR constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description/Issue #197 calls for an explicit “I²C Address” section (per the standard README template), but this README still doesn’t have an “I²C Address” heading; the address only appears in the Supported Sensor table. Add a dedicated section (e.g., documenting default
0x5Fand theaddress=init parameter) to match the harmonized format.