From 3f41008f21d7bdbd86b94f2394f8326ff0ae0864 Mon Sep 17 00:00:00 2001 From: dahanzimin <353767514@qq.com> Date: Wed, 26 Mar 2025 15:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E6=94=B9MS6511?= =?UTF-8?q?=E6=B0=94=E5=8E=8B=E4=BC=A0=E6=84=9F=E5=99=A8=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=8F=82=E8=80=83=E6=B0=94=E5=8E=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B5=B7=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boards/default_src/micropython/origin/build/lib/ms5611.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/boards/default_src/micropython/origin/build/lib/ms5611.py b/boards/default_src/micropython/origin/build/lib/ms5611.py index d17f3f37..ce3f48e1 100644 --- a/boards/default_src/micropython/origin/build/lib/ms5611.py +++ b/boards/default_src/micropython/origin/build/lib/ms5611.py @@ -69,7 +69,6 @@ class MS5611: P = (D1 * SENS / 2 ** 21 - OFF) / 2 ** 15 H = (1 - (P / 101325) ** (1 / 5.255)) * 44330 - return round(P / 100, 2), round(TEMP / 100, 2), round(H, 2) def pressure(self): @@ -78,5 +77,5 @@ class MS5611: def temperature(self): return self.getdata[1] - def altitude(self): - return self.getdata[2] + def altitude(self, reference=1013.25): + return (pow((reference / 33.8639), 0.190255) - pow((self.getdata[0] / 33.8639), 0.190255)) / 0.000013125214