RTC — 实时时钟

class RTC(...)

使用示例::(python)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# coding=utf-8
# This is a sample Python script.
from driver import RTC

print("-------------------rtc test--------------------")
rtc = RTC()
rtc.open()
rtc.setTime(21, 3, 19, 18, 25, 8)
value = rtc.getTime()
print(value)
rtc.close()
print("-------------------rtc test--------------------")

操作函数

open()

打开并创建RTC 实例

close()

关闭RTC实例

getTime()

读取RTC 时间视觉数据year, month, date, hr, min, sec

setTime(year, month, date, hr, min, sec)

设置RTC时间数据year, month, date, hr, min, sec