Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMP085 pressure calculation #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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: 3 additions & 2 deletions sensors/bmpBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def readPressure(self):
UP = 23843
self._cal_AC6 = 23153
self._cal_AC5 = 32757
self._cal_MB = -32767
self._cal_MC = -8711
self._cal_MD = 2868
self._cal_B1 = 6190
Expand All @@ -191,7 +192,7 @@ def readPressure(self):

# Pressure Calculations
B6 = B5 - 4000
X1 = (self._cal_B2 * (B6 * B6) >> 12) >> 11
X1 = (self._cal_B2 * ((B6 * B6) >> 12)) >> 11
X2 = (self._cal_AC2 * B6) >> 11
X3 = X1 + X2
B3 = (((self._cal_AC1 * 4 + X3) << self.mode) + 2) / 4
Expand Down Expand Up @@ -219,7 +220,7 @@ def readPressure(self):

X1 = (p >> 8) * (p >> 8)
X1 = (X1 * 3038) >> 16
X2 = (-7375 * p) >> 16
X2 = (-7357 * p) >> 16
if (self.debug):
print "DBG: p = %d" % (p)
print "DBG: X1 = %d" % (X1)
Expand Down