例程讲解14-WiFi-Shield->connect wifi连接

视频教程12 - WIFI无线图传:https://singtown.com/learn/50005/
视频教程39 - WIFI编程对OpenMV远程调试:https://singtown.com/learn/50899/
# WiFi连接例程
#
# 这个例子展示了如何将你的OpenMV Cam与WiFi扩展连接到网络。

import network
import time

SSID = ""  # Network SSID  填入WiFi名称
KEY = ""  # Network key  填入WiFi密码

# 初始化wlan模块并连接到网络
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID, KEY)

while not wlan.isconnected():
    print('Trying to connect to "{:s}"...'.format(SSID))
    time.sleep_ms(1000)

# 我们现在通过DHCP应该有一个有效的IP
print("WiFi Connected ", wlan.ifconfig())

results matching ""

    No results matching ""