File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
# bmp = BMP085(0x77, 3) # ULTRAHIRES Mode
18
18
19
19
temp = bmp .readTemperature ()
20
+
21
+ # Read the current barometric pressure level
20
22
pressure = bmp .readPressure ()
23
+
24
+ # To calculate altitude based on an estimated mean sea level pressure
25
+ # (1013.25 hPa) call the function as follows, but this won't be very accurate
21
26
altitude = bmp .readAltitude ()
22
27
28
+ # To specify a more accurate altitude, enter the correct mean sea level
29
+ # pressure level. For example, if the current pressure level is 1023.50 hPa
30
+ # enter 102350 since we include two decimal places in the integer value
31
+ # altitude = bmp.readAltitude(102350)
32
+
23
33
print "Temperature: %.2f C" % temp
24
34
print "Pressure: %.2f hPa" % (pressure / 100.0 )
25
35
print "Altitude: %.2f" % altitude
You can’t perform that action at this time.
0 commit comments