### Connect Pico to Wifi ### #Import the network module #The Pico W uses the built‑in CYW43439 Wi‑Fi chip, controlled through MicroPython’s network module. import network import time #Create a WLAN station interface #This puts the Pico W into Wi‑Fi client mode so it can join your router. wlan = network.WLAN(network.STA_IF) wlan.active(True) #Enter your Wi‑Fi SSID and password #You must provide your router’s network name and password. ssid = "YOUR-SSID" password = "YOUR-WIFI-PASSWORD" wlan.connect(ssid, password) #Wait for connection #The Pico W needs a few seconds to negotiate with your router. #Add a simple wait loop: while not wlan.isconnected(): print("Connecting...") time.sleep(0.5) #Print your IP address #This confirms the Pico W is online and shows the IP assigned by your router. print("Connected!") print(wlan.ifconfig())