Skip to content

Commit 403c7eb

Browse files
author
brentru
committed
switch to using pyportal group instead
1 parent ffe505d commit 403c7eb

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

PyPortal_Quarantine_Clock/code.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,17 @@ def wday_to_weekday_name(tm_wday):
7777
font_large.load_glyphs(b'abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890- ')
7878
font_small.load_glyphs(b'abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890- ()')
7979

80-
81-
# Set up display group
82-
splash = displayio.Group(max_size=10) # The Main Display Group
83-
view = displayio.Group(max_size=15) # Group for Text objects
84-
splash.append(view)
85-
8680
# Set up label for the day
8781
label_day = label.Label(font_large, color=0xFFFFFF, max_glyphs=200)
88-
label_day.x = board.DISPLAY.width // 4
82+
label_day.x = board.DISPLAY.width // 5
8983
label_day.y = 70
90-
view.append(label_day)
84+
pyportal.splash.append(label_day)
9185

9286
# Set up label for the time
9387
label_time = label.Label(font_small, color=0x538ab1, max_glyphs=200)
9488
label_time.x = board.DISPLAY.width // 4
9589
label_time.y = 150
96-
view.append(label_time)
97-
98-
# Show group splash
99-
board.DISPLAY.show(splash)
90+
pyportal.splash.append(label_time)
10091

10192
refresh_time = None
10293
while True:
@@ -118,7 +109,7 @@ def wday_to_weekday_name(tm_wday):
118109
weekday = wday_to_weekday_name(the_time.tm_wday)
119110

120111
# set the day label's text
121-
label_day.text = "{}".format(weekday)
112+
label_day.text = weekday
122113

123114
# set the time label's text
124115
label_time.text = "({})".format(time_name[the_time.tm_hour])

0 commit comments

Comments
 (0)