Skip to content

Commit 944553a

Browse files
author
Emre Harbutoğlu
authored
also we should call readFloatPressure() with readTempC() before calling readFloatAltitudeMeters() for correct result
1 parent f66146a commit 944553a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/SparkFunBME280.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ float BME280::readFloatAltitudeMeters( void )
477477
// code on those planets. Interplanetary selfies are welcome, however.
478478

479479
// firstly read temperature for avoiding wrong calculation
480+
readFloatPressure();
480481
readTempC();
481482

482483
heightOutput = ((float)-44330.77)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); //Corrected, see issue 30

0 commit comments

Comments
 (0)