@@ -91,7 +91,8 @@ class SGP40:
91
91
# Lets quickly grab the humidity and temperature
92
92
# temperature = bme280.temperature
93
93
# humidity = bme280.relative_humidity
94
- # compensated_raw_gas = sgp.measure_raw(temperature=temperature, relative_humidity=humidity)
94
+ # compensated_raw_gas = sgp.measure_raw(temperature=temperature,
95
+ # relative_humidity=humidity)
95
96
# temperature = temperature, relative_humidity = humidity)
96
97
97
98
@@ -109,6 +110,11 @@ class SGP40:
109
110
Prolonged exposures outside of these ranges may reduce sensor performance, and
110
111
the sensor must not be exposed towards condensing conditions at any time.
111
112
113
+ For more information see:
114
+ https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/9_Gas_Sensors/Datasheets/Sensirion_Gas_Sensors_Datasheet_SGP40.pdf
115
+ and
116
+ https://learn.adafruit.com/adafruit-sgp40
117
+
112
118
"""
113
119
114
120
def __init__ (self , i2c , address = 0x59 ):
@@ -160,7 +166,7 @@ def _reset(self):
160
166
sleep (1 )
161
167
162
168
@staticmethod
163
- def _temp_c_to_ticks (temperature ):
169
+ def _celsius_to_ticks (temperature ):
164
170
"""
165
171
Converts Temperature in Celsius to 'ticks' which are an input parameter
166
172
the sgp40 can use
@@ -217,7 +223,7 @@ def measure_raw(self, temperature=25, relative_humidity=50):
217
223
_compensated_read_cmd = [0x26 , 0x0F ]
218
224
humidity_ticks = self ._relative_humidity_to_ticks (relative_humidity )
219
225
humidity_ticks .append (self ._generate_crc (humidity_ticks ))
220
- temp_ticks = self ._temp_c_to_ticks (temperature )
226
+ temp_ticks = self ._celsius_to_ticks (temperature )
221
227
temp_ticks .append (self ._generate_crc (temp_ticks ))
222
228
_cmd = _compensated_read_cmd + humidity_ticks + temp_ticks
223
229
self ._measure_command = bytearray (_cmd )
0 commit comments