Fix BMP390 lag
This commit is contained in:
6
main.py
6
main.py
@@ -52,6 +52,8 @@ else:
|
|||||||
ssid = secrets['ssid']
|
ssid = secrets['ssid']
|
||||||
password = secrets['pw']
|
password = secrets['pw']
|
||||||
|
|
||||||
|
print('Connecting to WiFi network: ' + ssid)
|
||||||
|
|
||||||
wlan = network.WLAN(network.STA_IF)
|
wlan = network.WLAN(network.STA_IF)
|
||||||
wlan.active(True)
|
wlan.active(True)
|
||||||
wlan.connect(ssid, password)
|
wlan.connect(ssid, password)
|
||||||
@@ -122,7 +124,7 @@ if devices.count(0x77) > 0:
|
|||||||
bmp390.set_sampling_period(5)
|
bmp390.set_sampling_period(5)
|
||||||
bmp390.set_iir_filter(2)
|
bmp390.set_iir_filter(2)
|
||||||
#
|
#
|
||||||
#bmp390.start_measurement(True, True, 1)
|
bmp390.start_measurement(True, True, 2)
|
||||||
else:
|
else:
|
||||||
bmp390 = None
|
bmp390 = None
|
||||||
|
|
||||||
@@ -142,7 +144,7 @@ while True:
|
|||||||
|
|
||||||
temp_bmp390, pressure_bmp390, time_bmp390 = None, None, None
|
temp_bmp390, pressure_bmp390, time_bmp390 = None, None, None
|
||||||
if bmp390 is not None:
|
if bmp390 is not None:
|
||||||
bmp390.start_measurement(True, True, 1)
|
#bmp390.start_measurement(True, True, 1)
|
||||||
s = bmp390.get_status()
|
s = bmp390.get_status()
|
||||||
while not s[2] or not s[1]:
|
while not s[2] or not s[1]:
|
||||||
time.sleep_ms(10)
|
time.sleep_ms(10)
|
||||||
|
|||||||
Reference in New Issue
Block a user