1528 views|1 replies

1w

Posts

25

Resources
The OP
 

[SAMR21 New Gameplay] 33. RTC [Copy link]

 
This post was last edited by dcexpert on 2019-10-18 09:19

CircuitPython supports RTC function. The use of RTC is very simple, the basic usage is as follows:

import rtc
r = rtc.RTC()
r.datetime

The return value of datetime is a struct_time class, such as:

struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=17, tm_sec=53, tm_wday=5, tm_yday=1, tm_isdst=-1)

If you need to change the time of rtc, just assign a value to datetime. The parameter type is also struct_time, such as:

r.datetime = time.struct_time((2019,10,17,22,00,00,4,1,-1))



This content is originally created by dcexpert , a user of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

 
 

1w

Posts

25

Resources
2
 

Compared to MicroPython, CircuitPython currently has fewer RTC functions and does not support RTC callback functions, so it cannot wake up from sleep via RTC. In addition, it should be noted that the time formats of the two are also different.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list