import time import machine import badger2040 try: badger2040.pcf_to_pico_rtc() except RuntimeError: pass rtc = machine.RTC() # set the clock to a reasonable default value year, month, day, wd, hour, minute, second, _ = rtc.datetime() if (year, month, day) == (2021, 1, 1): rtc.datetime((2022, 2, 28, 0, 12, 0, 0, 0)) while True: # get the clock value year, month, day, wd, hour, minute, second, _ = rtc.datetime() # do stuff here # avoid updating the display unless you absolutely have to! # even fast updates are costly time.sleep(0.01)