Skip to content

Commit d74daa0

Browse files
committed
fixed example 1 hertz
1 parent 1461df5 commit d74daa0

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

README.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,24 @@ For humidity compensated raw gas and voc index readings, we'll need a secondary
9292
humidity = bme280.relative_humidity
9393
9494
# For compensated raw gas readings
95-
compensated_raw_gas = sgp.measure_raw(temperature = temperature, relative_humidity = humidity)
96-
97-
time.sleep(1)
95+
"""
96+
compensated_raw_gas = sgp.measure_raw(
97+
temperature=temperature, relative_humidity=humidity
98+
)
99+
print("Raw Data:", compensated_raw_gas)
100+
"""
98101
99102
# For Compensated voc index readings
100-
voc_index = sgp.measure_index(temperature = temperature, relative_humidity = humidity)
103+
voc_index = sgp.measure_index(
104+
temperature=temperature, relative_humidity=humidity)
101105
102-
print(compensated_raw_gas)
103-
print(voc_index)
106+
print("VOC Index:", voc_index)
104107
print("")
105108
time.sleep(1)
106109
107-
108110
It may take several minutes for the VOC index to start changing as it calibrates the baseline readings.
111+
The voc algorithm expects a 1 hertz sampling rate. Run `measure_index()` once per second.
112+
109113

110114
Contributing
111115
============

examples/sgp40_indextest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
humidity = bme280.relative_humidity
1919

2020
# For compensated raw gas readings
21+
"""
2122
compensated_raw_gas = sgp.measure_raw(
2223
temperature=temperature, relative_humidity=humidity
2324
)
24-
25-
time.sleep(1)
25+
print("Raw Data:", compensated_raw_gas)
26+
"""
2627

2728
# For Compensated voc index readings
29+
# The algorithm expects a 1 hertz sampling rate. Run "measure index" once per second.
2830
# It may take several minutes for the VOC index to start changing
2931
# as it calibrates the baseline readings.
3032
voc_index = sgp.measure_index(temperature=temperature, relative_humidity=humidity)
3133

32-
print("Raw Data:", compensated_raw_gas)
3334
print("VOC Index:", voc_index)
3435
print("")
3536
time.sleep(1)

0 commit comments

Comments
 (0)