Skip to content

Instantly share code, notes, and snippets.

@narikakun
Created July 30, 2023 13:01
Show Gist options
  • Save narikakun/ed738a0bd46ccb58dfc68a63bee95f16 to your computer and use it in GitHub Desktop.
Save narikakun/ed738a0bd46ccb58dfc68a63bee95f16 to your computer and use it in GitHub Desktop.
Raspberry Pi Pico WをWiFiにつなぐ
import network
WIFI_SSID = "WiFi SSID"
WIFI_PASSWORD = "WiFi Password"
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.config(pm = 0xa11140) # Disable power-save mode
if not wlan.isconnected():
wlan.connect(WIFI_SSID, WIFI_PASSWORD)
while not wlan.isconnected():
pass
print("WiFiに接続しました")
print("IPアドレス:", wlan.ifconfig()[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment