Example: 50-Arduino-Boards/Portenta-H7/53-Ethernet/eth_cable_test.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 以太网电缆状态示例。
#
# 此示例打印电缆连接状态。

import network
import time

lan = network.LAN()

# 确保以太网未处于低功耗模式。
lan.config(low_power=False)

# 自动协商延迟
time.sleep(3.0)

while True:
    print("Cable is", "connected." if lan.status() else "disconnected.")
    time.sleep(1.0)

# 如果需要,将以太网重新置于低功耗模式。
# lan.config(low_power=True)

results matching ""

    No results matching ""