From f79a17e97f56769192d900353498ed972d2491ed Mon Sep 17 00:00:00 2001 From: bradcar Date: Tue, 19 Nov 2024 13:16:35 -0800 Subject: [PATCH] Update bmp581.py --- micropython_bmp581/bmp581.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/micropython_bmp581/bmp581.py b/micropython_bmp581/bmp581.py index 05dc6ed..6b8fbe9 100644 --- a/micropython_bmp581/bmp581.py +++ b/micropython_bmp581/bmp581.py @@ -267,10 +267,12 @@ def altitude(self) -> float: With the measured pressure p and the pressure at sea level p0 e.g. 1013.25hPa, the altitude in meters can be calculated with the international barometric formula """ + # was ** 0.190284, should be ** 0.190295 or better ** (1.0 / 5.255)) altitude = 44330.0 * ( - 1.0 - ((self.pressure / self.sea_level_pressure) ** 0.190284) + 1.0 - ((self.pressure / self.sea_level_pressure) ** (1.0 / 5.255)) ) - return round(altitude, 1) + # was round(altitude, 1), rounding limits accuracy to 100cm, sensor +/- cm + return altitude @altitude.setter def altitude(self, value: float) -> None: