>>> from pyb import RTC
>>>help(RTC)
object <class 'RTC'> is of type type
init --<function>
info --<function>
datetime --<function>
wakeup --<function>
calibration --<function>
from pyb import RTC
import time
# 定义星期数组
weekdays =['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
rtc =RTC()
rtc.datetime((2023,11,28,2,21,10,15,0)) # set a specific date and time
if __name__ =='__main__':while True:#Get the current time from the RTC
current_time = rtc.datetime()print(current_time) # get date and time
time.sleep(1)
year, month, day,weekday, hour, minute, second, yearday = rtc.datetime()
# 获取星期对应的数组成员
weekday_name = weekdays[weekday]print("当前时间:{}-{}-{} {}:{}:{} Week:{}".format(year, month, day, hour, minute, second,weekday_name))
数据在内存中的存储练习题 文章目录 数据在内存中的存储练习题1. 练习一2.练习二3. 练习三4. 练习四5. 练习五6. 练习六7. 总结 1. 练习一
#include <stdio.h>int main()
{char a -1;signed b -1;unsigned char c -1;printf("a %d b %d c %d", a, b, c)…