Fix BMP390 lag

This commit is contained in:
Ádám Kovács
2023-11-20 22:08:11 +01:00
parent 0ef4b68128
commit 7fb0347b84

View File

@@ -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)