Example: 50-Arduino-Boards/Nicla-Vision/53-Low-Power/deep_sleep.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 深度睡眠模式示例
# 此示例演示了低功耗深度睡眠模式加上传感器关闭。
# 注意,相机在从深度睡眠唤醒后会重置。要确定重置的原因
# 是否是深度睡眠,调用 machine.reset_cause() 函数并测试 machine.DEEPSLEEP_RESET
import machine
import sensor

# 创建并初始化 RTC 对象。
rtc = machine.RTC()

# (年,月,日[,小时[,分钟[,秒[,微秒[,时区信息]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))

# 打印 RTC 信息。
print(rtc.datetime())

sensor.reset()

# 关闭传感器(将 PWDN 拉高)。
sensor.shutdown(True)

# 每 30 秒启用 RTC 中断。
# 注意,相机在从深度睡眠模式唤醒后会重置。
rtc.wakeup(30000)

# 进入深度睡眠模式。
machine.deepsleep()

results matching ""

    No results matching ""