Skip to content

Commit 58af825

Browse files
authored
Refine Wi-Fi connection status messages / clear screen correctly
1 parent 469f928 commit 58af825

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

examples/interstate75/flight_display.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def network_connect(ssid, password):
6161
display.set_pen(BLACK)
6262
display.clear()
6363
display.set_pen(WHITE)
64-
display.text("Connecting to Wi-Fi...", 2, 2, WIDTH, 1)
64+
display.text("Connecting to Wi-fi...", 2, 2, WIDTH, 1)
6565
i75.update()
6666

6767
wlan.connect(ssid, password)
@@ -72,10 +72,7 @@ def network_connect(ssid, password):
7272
if status < 0 or status >= 3:
7373
break
7474
max_wait -= 1
75-
print('Waiting for connection...')
76-
display.set_pen(WHITE)
77-
display.text(f"Wi-Fi {max_wait}", 2, 2, WIDTH, 1)
78-
i75.update()
75+
print('Waiting for Wi-Fi connection...')
7976
time.sleep(1)
8077

8178
if wlan.status() != 3:
@@ -89,8 +86,9 @@ def network_connect(ssid, password):
8986
print('Connected to Wi-Fi')
9087
status = wlan.ifconfig()
9188
print(f'IP: {status[0]}')
92-
display.set_pen(WHITE)
89+
display.set_pen(BLACK)
9390
display.clear()
91+
display.set_pen(WHITE)
9492
display.text("Connected", 2, 2, WIDTH, 1)
9593
i75.update()
9694
return True

0 commit comments

Comments
 (0)