Skip to content

Commit dbceccb

Browse files
authored
Merge pull request #11 from WoefulDerelict/periodic_data_acquisition
Include support for periodic data acquisition mode.
2 parents 40d5609 + 032053c commit dbceccb

File tree

4 files changed

+359
-41
lines changed

4 files changed

+359
-41
lines changed

README.rst

+32
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,38 @@ And then you can start measuring the temperature and humidity:
6363
print(sensor.temperature)
6464
print(sensor.relative_humidity)
6565
66+
You can instruct the sensor to periodically measure the temperature and
67+
humidity, storing the result in its internal cache:
68+
69+
.. code:: python
70+
71+
sensor.mode = adafruit_sht31d.MODE_PERIODIC
72+
73+
You can adjust the frequency at which the sensor periodically gathers data to:
74+
0.5, 1, 2, 4 or 10 Hz. The following adjusts the frequency to 2 Hz:
75+
76+
.. code:: python
77+
78+
sensor.frequency = adafruit_sht31d.FREQUENCY_2
79+
80+
The sensor is capable of storing eight results. The sensor stores these
81+
results in an internal FILO cache. Retrieving these results is simlilar to
82+
taking a measurement. The sensor clears its cache once the stored data is read.
83+
The sensor always returns eight data points. The list of results is backfilled
84+
with the maximum output values of 130.0 ºC and 100.01831417975366 % RH:
85+
86+
.. code:: python
87+
88+
print(sensor.temperature)
89+
print(sensor.relative_humidity)
90+
91+
The sensor will continue to collect data at the set interval until it is
92+
returned to single shot data acquisition mode:
93+
94+
.. code:: python
95+
96+
sensor.mode = adafruit_sht31d.MODE_SINGLE
97+
6698
Contributing
6799
============
68100

0 commit comments

Comments
 (0)