Commit dc31a344 authored by Tom Hartley's avatar Tom Hartley

Merge pull request #5 from Nocturnal42/master

MSL Pressure
parents d3eebcd2 b8367771
#!/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