-
Notifications
You must be signed in to change notification settings - Fork 4
VOC Index #9
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
VOC Index #9
Changes from 10 commits
7b80869
7cca585
c7bc34d
b0d6406
791e169
e5af7e2
69b093c
82368d6
63287a6
8df1cc5
a4960df
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 |
---|---|---|
|
@@ -74,7 +74,7 @@ Usage Example | |
print("") | ||
sleep(1) | ||
|
||
For humidity compensated raw gas readings, we'll need a secondary sensor such as the bme280 | ||
For humidity compensated raw gas and voc index readings, we'll need a secondary sensor such as the bme280 | ||
|
||
.. code-block:: python3 | ||
|
||
|
@@ -90,12 +90,20 @@ For humidity compensated raw gas readings, we'll need a secondary sensor such as | |
while True: | ||
temperature = bme280.temperature | ||
humidity = bme280.relative_humidity | ||
compensated_raw_gas = sgp.measure_raw(temperature = temperature, relative_humidity = humidity) | ||
|
||
# For compensated raw gas readings | ||
compensated_raw_gas = sgp.raw(temperature = temperature, relative_humidity = humidity) | ||
|
||
# For Compensated voc index readings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There might also need to be a time.sleep(1) here, or we can comment out one of the examples (in this case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch, datasheet says 1s typical, .5s min |
||
voc_index = sgp.measure_index(temperature = temperature, relative_humidity = humidity) | ||
|
||
print(compensated_raw_gas) | ||
print(voc_index) | ||
print("") | ||
time.sleep(1) | ||
|
||
|
||
It may take several minutes for the VOC index to start changing as it calibrates the baseline readings. | ||
|
||
Contributing | ||
============ | ||
|
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.
sgp.raw
doesn't take in any inputs, you'll needmeasure_raw
in it's place