TiLDA MK3/rtc

From EMF Badge
Revision as of 00:52, 2 March 2017 by Claude (talk | contribs) (fix broken link to micropython rtc docs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The following code snippets demonstrate the RTC. See the micropython docs [1] for more information.

# Create a RTC object
rtc = pyb.RTC()

# If the RTC isn't running, call
rtc.init()

# Set the time 
rtc.datetime((2016, 5, 1, 4, 13, 0, 0, 0))

# Get the time
print(rtc.datetime())