mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
22 lines
567 B
Python
22 lines
567 B
Python
# This work is licensed under the MIT license.
|
|
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
|
|
# https://github.com/openmv/openmv/blob/master/LICENSE
|
|
#
|
|
# Connect Example
|
|
#
|
|
# This example shows how to connect your OpenMV Cam with a WiFi shield to the net.
|
|
|
|
import network
|
|
|
|
SSID = "" # Network SSID
|
|
KEY = "" # Network key
|
|
|
|
# Init wlan module and connect to network
|
|
print("Trying to connect... (may take a while)...")
|
|
|
|
wlan = network.WINC()
|
|
wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)
|
|
|
|
# We should have a valid IP now via DHCP
|
|
print(wlan.ifconfig())
|