From 7fb0347b8407aef60c501df47ce8406a64cb5681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Mon, 20 Nov 2023 22:08:11 +0100 Subject: [PATCH] Fix BMP390 lag --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 4e266af..21425f8 100644 --- a/main.py +++ b/main.py @@ -52,6 +52,8 @@ else: ssid = secrets['ssid'] password = secrets['pw'] +print('Connecting to WiFi network: ' + ssid) + wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect(ssid, password) @@ -122,7 +124,7 @@ if devices.count(0x77) > 0: bmp390.set_sampling_period(5) bmp390.set_iir_filter(2) # - #bmp390.start_measurement(True, True, 1) + bmp390.start_measurement(True, True, 2) else: bmp390 = None @@ -142,7 +144,7 @@ while True: temp_bmp390, pressure_bmp390, time_bmp390 = None, None, None if bmp390 is not None: - bmp390.start_measurement(True, True, 1) + #bmp390.start_measurement(True, True, 1) s = bmp390.get_status() while not s[2] or not s[1]: time.sleep_ms(10)