2022-02-22 13:45:11 +00:00
|
|
|
import time
|
|
|
|
import badger2040
|
|
|
|
from machine import RTC
|
|
|
|
|
|
|
|
rtc = RTC()
|
|
|
|
screen = badger2040.Badger2040()
|
|
|
|
screen.update_speed(badger2040.UPDATE_TURBO)
|
2022-02-23 16:08:06 +00:00
|
|
|
screen.font("gothic")
|
2022-02-22 13:45:11 +00:00
|
|
|
|
2022-02-24 14:30:42 +00:00
|
|
|
year, month, day, wd, hour, minute, second, _ = rtc.datetime()
|
|
|
|
|
|
|
|
if (year, month, day) == (2021, 1, 1):
|
|
|
|
rtc.datetime((2022, 2, 25, 3, 12, 0, 0, 0))
|
|
|
|
|
2022-02-22 13:45:11 +00:00
|
|
|
while True:
|
|
|
|
year, month, day, wd, hour, minute, second, _ = rtc.datetime()
|
2022-02-23 16:08:06 +00:00
|
|
|
hms = "{:02}:{:02}:{:02}".format(hour, minute, second)
|
2022-02-22 13:45:11 +00:00
|
|
|
ymd = "{:04}/{:02}/{:02}".format(year, month, day)
|
|
|
|
|
|
|
|
screen.pen(15)
|
|
|
|
screen.clear()
|
2022-02-23 16:08:06 +00:00
|
|
|
screen.pen(0)
|
2022-02-22 13:45:11 +00:00
|
|
|
screen.thickness(5)
|
2022-02-23 16:08:06 +00:00
|
|
|
screen.text(hms, 0, 40, 1.8)
|
2022-02-22 13:45:11 +00:00
|
|
|
screen.thickness(3)
|
2022-02-23 16:08:06 +00:00
|
|
|
screen.text(ymd, 0, 100, 1.0)
|
|
|
|
|
|
|
|
screen.update()
|
2022-02-22 13:45:11 +00:00
|
|
|
|
2022-02-22 14:39:45 +00:00
|
|
|
time.sleep(0.5)
|