Skip to content

Commit 8ac1162

Browse files
committed
Adding temp correction from @cz6ace
1 parent a751292 commit 8ac1162

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/SparkFunBME280.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ BME280::BME280( void )
4747
settings.tempOverSample = 1;
4848
settings.pressOverSample = 1;
4949
settings.humidOverSample = 1;
50+
settings.tempCorrection = 0.0; // correction of temperature - added to the result
5051
}
5152

5253

@@ -482,7 +483,7 @@ float BME280::readTempC( void )
482483
t_fine = var1 + var2;
483484
float output = (t_fine * 5 + 128) >> 8;
484485

485-
output = output / 100;
486+
output = output / 100 + settings.tempCorrection;
486487

487488
return output;
488489
}

src/SparkFunBME280.h

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct SensorSettings
128128
uint8_t tempOverSample;
129129
uint8_t pressOverSample;
130130
uint8_t humidOverSample;
131+
float tempCorrection; // correction of temperature - added to the result
131132
};
132133

133134
//Used to hold the calibration constants. These are used

0 commit comments

Comments
 (0)