Commit 9ec4da5d authored by Nocturnal42's avatar Nocturnal42

Added calculation for MSL adjusted pressure.

parent a867d171
#!/usr/bin/python
#!/usr/bin/python
import time
import math
from Adafruit_I2C import Adafruit_I2C
# ===========================================================================
......@@ -240,6 +243,14 @@ class BMP085 :
return 0
def readMSLPressure(self, altitude):
"Calculates the mean sea level pressure"
pressure = float(self.readPressure())
T0 = float(altitude) / 44330
T1 = math.pow(1 - T0, 5.255)
mslpressure = pressure / T1
return mslpressure
if __name__=="__main__":
bmp = BMP085()
print str(bmp.readTemperature()) + " C"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment