Skip to content

Commit 035bdd9

Browse files
committed
Correcting coefficient in alt calculation. Fixes issue #30
1 parent f9038f3 commit 035bdd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SparkFunBME280.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ float BME280::readFloatAltitudeMeters( void )
418418
{
419419
float heightOutput = 0;
420420

421-
heightOutput = ((float)-45846.2)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1);
421+
//heightOutput = ((float)-45846.2)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1);
422+
heightOutput = ((float)-44330.77)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); //Corrected, see issue 30
422423
return heightOutput;
423424

424425
}

0 commit comments

Comments
 (0)