Skip to content

Commit ed6eb7e

Browse files
Merge pull request #41 from hybridOL/master
Add method for setting temperature correction
2 parents 87fea48 + 62d8a50 commit ed6eb7e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/SparkFunBME280.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +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
50+
settings.tempCorrection = 0.f; // correction of temperature - added to the result
5151
}
5252

5353

@@ -453,6 +453,11 @@ float BME280::readFloatHumidity( void )
453453
//
454454
//****************************************************************************//
455455

456+
void BME280::setTemperatureCorrection(float corr)
457+
{
458+
settings.tempCorrection = corr;
459+
}
460+
456461
float BME280::readTempC( void )
457462
{
458463
// Returns temperature in DegC, resolution is 0.01 DegC. Output value of “5123” equals 51.23 DegC.

src/SparkFunBME280.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ class BME280
223223

224224
float readFloatHumidity( void );
225225

226-
//Temperature related methods
226+
//Temperature related methods
227+
void setTemperatureCorrection(float corr);
227228
float readTempC( void );
228229
float readTempF( void );
229230

@@ -258,4 +259,4 @@ class BME280
258259
float _referencePressure = 101325.0; //Default but is changeable
259260
};
260261

261-
#endif // End of __BME280_H__ definition check
262+
#endif // End of __BME280_H__ definition check

0 commit comments

Comments
 (0)