mirror of
https://github.com/micropython/micropython.git
synced 2025-09-08 02:40:55 +02:00
To keep them all together, mirroring the top-level directory structure. Signed-off-by: Damien George <damien@micropython.org>
13 lines
218 B
Python
13 lines
218 B
Python
import machine
|
|
from machine import RTC
|
|
import time
|
|
|
|
rtc = RTC()
|
|
rtc.init()
|
|
print(rtc)
|
|
|
|
# make sure that 1 second passes correctly
|
|
rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0))
|
|
time.sleep_ms(1002)
|
|
print(rtc.datetime()[:7])
|