Skip to content

Commit 749e2b2

Browse files
committed
2 parents 1f4a088 + f4c207c commit 749e2b2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Adafruit_MPL115A2/Adafruit_MPL115A2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def readCalibrationData(self):
114114
self._mpl115a2_b1 /= 8192.0
115115
self._mpl115a2_b2 /= 16384.0
116116
self._mpl115a2_c12 /= 4194304.0
117-
self._mpl115a2_c12 /= 10**9
117+
#self._mpl115a2_c12 /= 10**9
118118

119119
if (self.debug):
120120
self.showCalibrationData()
@@ -149,7 +149,7 @@ def getPT(self):
149149
pressureComp = self._mpl115a2_a0 + (self._mpl115a2_b1 + self._mpl115a2_c12 * temp) * pressure + self._mpl115a2_b2 * temp
150150
P = ((65.0 / 1023) * pressureComp) + 50.0
151151
T = ((temp - 498.0) / -5.35 + 25.0)
152-
return P,T
152+
return P,T, temp
153153

154154

155155
def readRawPressure(self):

Adafruit_MPL115A2/test.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
# bmp = BMP085(0x77, 2) # HIRES Mode
1717
# bmp = BMP085(0x77, 3) # ULTRAHIRES Mode
1818

19-
temp, pressure = mpl.getPT()
19+
temp, pressure, temp2 = mpl.getPT()
2020

2121
# temp = mpl.readTemperature()
2222
# pressure = mpl.readPressure()
2323
# altitude = mpl.readAltitude()
2424

2525
print "Temperature: %.2f C" % temp
2626
print "Temperature: %.2f F" % (temp * 9 / 5 + 32)
27+
print "Temperature: %.2f C" % temp2
28+
print "Temperature: %.2f F" % (temp2 * 9 / 5 + 32)
2729
print "Pressure: %.2f hPa" % (pressure / 100.0)
2830
#print "Altitude: %.2f" % altitude

0 commit comments

Comments
 (0)