Skip to content

Commit 8354a84

Browse files
committed
add wake up time
1 parent 5899438 commit 8354a84

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

PyPortal_Wakeup_Light/wake_up_light.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,40 @@
5151
info_font = cwd+"/fonts/Nunito-Black-17.bdf"
5252
time_font = cwd+"/fonts/Nunito-Light-75.bdf"
5353

54+
# Type in time to get up
55+
input_wake_up_time = "6:30"
56+
input_wake_up_time_text = "Wake up at: " + input_wake_up_time + "am"
57+
#light_on_time_text = "Light starting at: " # - 30 minutes? how?
58+
5459
# create text object group
5560
text_group = displayio.Group(max_size=6)
5661
text_group.append(text_group)
5762

5863
print('loading fonts...')
5964
glyphs = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,.:/ '
6065

66+
# Font for time
6167
time_font = bitmap_font.load_font(time_font)
6268
time_font.load_glyphs(glyphs)
6369

70+
# Font for other info
71+
info_font = bitmap_font.load_font(info_font)
72+
info_font.load_glyphs(glyphs)
73+
6474
# Time
65-
time_text = Label( time_font, max_glyphs=40)
75+
time_text = Label(time_font, max_glyphs=40)
6676
time_text.x = 65
6777
time_text.y = 120
6878
text_group.append(time_text)
79+
80+
# Wake up time
81+
wakeup_time_text = Label(info_font, text= input_wake_up_time_text)
82+
wakeup_time_text.x = 15
83+
wakeup_time_text.y = 200
84+
text_group.append(wakeup_time_text)
85+
6986
board.DISPLAY.show(time_text)
87+
# board.DISPLAY.show(text_group) # when running this line, the pyportal crashes
7088

7189
# Create an instance of the Adafruit IO REST client
7290
io = RESTClient(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)

0 commit comments

Comments
 (0)