Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/SparkFunBME280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ float BME280::readFloatAltitudeMeters( void )
// see NRLMSISE-00. That's why it is the "international" formula, not "interplanetary".
// Sparkfun is not liable for incorrect altitude calculations from this
// code on those planets. Interplanetary selfies are welcome, however.

// firstly read temperature for avoiding wrong calculation
readFloatPressure();
readTempC();

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

Expand Down