We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c9721c commit 826eed3Copy full SHA for 826eed3
adafruit_bmp280.py
@@ -368,6 +368,14 @@ def altitude(self) -> float:
368
- which you must enter ahead of time)"""
369
p = self.pressure # in Si units for hPascal
370
return 44330 * (1.0 - math.pow(p / self.sea_level_pressure, 0.1903))
371
+
372
+ @property
373
+ def p0(self, altitude_m=0.0) -> float:
374
+ """The calculated sea level pressure based on altitude (:attr:`altitude`)
375
+ - which you must enter ahead of time)"""
376
+ p = self.pressure # in Si units for hPascal
377
+ p0 = p / math.pow(1.0 - altitude_m/44330.0, 5.255)
378
+ return p0
379
380
####################### Internal helpers ################################
381
def _read_coefficients(self) -> None:
0 commit comments