Example: 50-OpenMV-Boards/52-Alif-Boards/50-Board-Control/rtc.py
# 本作品采用MIT许可证授权。
# Copyright (c) 2013-2026 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# RTC 示例
#
# 此示例展示了如何使用 RTC。
import time
from machine import RTC
rtc = RTC()
# 注释掉这部分以初始化RTC时间和日期。
# (year, month, day, weekday, hour, minute, second, microsecond)
# rtc.datetime((2026, 1, 1, 4, 12, 0, 0, 0))
while True:
time.sleep_ms(100)
print(rtc.datetime())