Connect to Wi-Fi
Join a Wi-Fi network and print the board's address.
A starter program from the MantisIDE Full IDE (Tools › Examples). Press Open in Full IDE to run it on your board, change it, and save it as your own.
# Join a Wi-Fi network and print the board's address.
import network, time
SSID = "your-network"
PASSWORD = "your-password"
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
wlan.connect(SSID, PASSWORD)
for _ in range(40):
if wlan.isconnected():
break
time.sleep(0.25)
print("Connected:", wlan.isconnected(), wlan.ifconfig()[0])
Comments