Example: 50-OpenMV-Boards/53-N6-Boards/50-Board-Control/power_good_pin.py

# 本作品采用MIT许可证授权。
# Copyright (c) 2013-2026 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 电源良好引脚
#
# 电源良好引脚是OpenMV Cam上的一个内部引脚
# which goes low when the board has external power and high
# when it does not. You can use this pin to tell if you are
# running on an external battery.
#
# 运行此示例时,请连接电池,然后断开
# OpenMV Cam与计算机的连接,以看到红灯亮起。
# 当你重新连接相机电源时,红灯将熄灭。

import machine

pg = machine.Pin("PG", machine.Pin.IN)
r = machine.LED("LED_RED")

while True:
    r.value(pg.value())

results matching ""

    No results matching ""