Closed sphh closed 10 years ago
I missed a function to calculate the pressure at sea level if the the altitude is known.
Adafruit_BMP085.h:
int32_t readSealevelpressure(float altitude = 0); // std atmosphere
Adafruit_BMP085.c:
int32_t Adafruit_BMP085::readSealevelpressure(float altitude) { int32_t sealevelPressure;
float pressure = readPressure();
sealevelPressure = (int32_t)(pressure / pow(1.0-altitude/44330, 5.255));
return sealevelPressure; }
Thanks for the suggestion and apologies it couldn't be integrated sooner. I just committed a change to add this function and document it in the example. Thanks again for the suggestion!
I missed a function to calculate the pressure at sea level if the the altitude is known.
Adafruit_BMP085.h:
int32_t readSealevelpressure(float altitude = 0); // std atmosphere
Adafruit_BMP085.c:
int32_t Adafruit_BMP085::readSealevelpressure(float altitude) { int32_t sealevelPressure;
float pressure = readPressure();
sealevelPressure = (int32_t)(pressure / pow(1.0-altitude/44330, 5.255));
return sealevelPressure; }