Skip to content

Commit b22602c

Browse files
authored
Merge pull request #29 from gphi/measure-raw-sensor-data
Measure raw sensor data
2 parents ed53d2e + 59730ee commit b22602c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

adafruit_sgp30.py

+17
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ def baseline_eCO2(self):
100100
"""Carbon Dioxide Equivalent baseline value"""
101101
return self.get_iaq_baseline()[0]
102102

103+
@property
104+
# pylint: disable=invalid-name
105+
def Ethanol(self):
106+
"""Ethanol Raw Signal in ticks"""
107+
return self.raw_measure()[1]
108+
109+
@property
110+
# pylint: disable=invalid-name
111+
def H2(self):
112+
"""H2 Raw Signal in ticks"""
113+
return self.raw_measure()[0]
114+
103115
def iaq_init(self):
104116
"""Initialize the IAQ algorithm"""
105117
# name, command, signals, delay
@@ -110,6 +122,11 @@ def iaq_measure(self):
110122
# name, command, signals, delay
111123
return self._run_profile(["iaq_measure", [0x20, 0x08], 2, 0.05])
112124

125+
def raw_measure(self):
126+
"""Measure H2 and Ethanol (Raw Signals)"""
127+
# name, command, signals, delay
128+
return self._run_profile(["raw_measure", [0x20, 0x50], 2, 0.025])
129+
113130
def get_iaq_baseline(self):
114131
"""Retreive the IAQ algorithm baseline for eCO2 and TVOC"""
115132
# name, command, signals, delay

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"Programming Language :: Python :: 3.5",
4646
],
4747
# What does your project relate to?
48-
keywords="adafruit sensiron sgp30 gas sensor eco2 tvoc i2c hardware micropython circuitpython",
48+
keywords="adafruit sensiron sgp30 gas sensor eco2 tvoc h2 ethanol i2c hardware micropython circuitpython",
4949
# You can just specify the packages manually here if your project is
5050
# simple. Or you can use find_packages().
5151
py_modules=["adafruit_sgp30"],

0 commit comments

Comments
 (0)