Created
July 30, 2023 13:01
-
-
Save narikakun/ed738a0bd46ccb58dfc68a63bee95f16 to your computer and use it in GitHub Desktop.
Raspberry Pi Pico WをWiFiにつなぐ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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