File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -238,21 +238,21 @@ def measure(self):
238
238
239
239
# Compensation based on datasheet section 4.3
240
240
d = self .i2c .readfrom_mem (self .addr , _QMP6988_DATA , _QMP6988_DATA_LEN )
241
- dp = ((d [0 ] << 16 ) | (d [1 ] << 8 ) | d [2 ]) - 2 ** 23
242
- dt = ((d [3 ] << 16 ) | (d [4 ] << 8 ) | d [5 ]) - 2 ** 23
241
+ dp = ((d [0 ] << 16 ) | (d [1 ] << 8 ) | d [2 ]) - 2 ** 23
242
+ dt = ((d [3 ] << 16 ) | (d [4 ] << 8 ) | d [5 ]) - 2 ** 23
243
243
244
- tr = self .a0 + (self .a1 * dt ) + (self .a2 * (dt ** 2 ))
244
+ tr = self .a0 + (self .a1 * dt ) + (self .a2 * (dt ** 2 ))
245
245
246
246
pr = (
247
247
self .b00
248
248
+ (self .bt1 * tr )
249
249
+ (self .bp1 * dp )
250
250
+ (self .b11 * tr * dp )
251
- + (self .bt2 * tr ** 2 )
252
- + (self .bp2 * dp ** 2 )
253
- + (self .b12 * dp * (tr ** 2 ))
254
- + (self .b21 * (dp ** 2 ) * tr )
255
- + (self .bp3 * (dp ** 3 ))
251
+ + (self .bt2 * tr ** 2 )
252
+ + (self .bp2 * dp ** 2 )
253
+ + (self .b12 * dp * (tr ** 2 ))
254
+ + (self .b21 * (dp ** 2 ) * tr )
255
+ + (self .bp3 * (dp ** 3 ))
256
256
)
257
257
258
258
temperature = (tr / 256 ) if temp_en else 0.0
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ async def start(self):
48
48
await self ._write_values (_SCD40_CMD_REINIT , delay_ms = 1000 )
49
49
# temperature offset can only be configured in idle mode
50
50
if self .temp_offset is not None :
51
- t = int ((self .temp_offset * 2 ** 16 ) / 175 )
51
+ t = int ((self .temp_offset * 2 ** 16 ) / 175 )
52
52
await self ._write_values (_SCD40_CMD_SET_TEMPERATURE_OFFSET , (t ,))
53
53
54
54
# create background task and wait for measurements to arrive
You can’t perform that action at this time.
0 commit comments