|
51 | 51 | info_font = cwd+"/fonts/Nunito-Black-17.bdf" |
52 | 52 | time_font = cwd+"/fonts/Nunito-Light-75.bdf" |
53 | 53 |
|
| 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 | + |
54 | 59 | # create text object group |
55 | 60 | text_group = displayio.Group(max_size=6) |
56 | 61 | text_group.append(text_group) |
57 | 62 |
|
58 | 63 | print('loading fonts...') |
59 | 64 | glyphs = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,.:/ ' |
60 | 65 |
|
| 66 | +# Font for time |
61 | 67 | time_font = bitmap_font.load_font(time_font) |
62 | 68 | time_font.load_glyphs(glyphs) |
63 | 69 |
|
| 70 | +# Font for other info |
| 71 | +info_font = bitmap_font.load_font(info_font) |
| 72 | +info_font.load_glyphs(glyphs) |
| 73 | + |
64 | 74 | # Time |
65 | | -time_text = Label( time_font, max_glyphs=40) |
| 75 | +time_text = Label(time_font, max_glyphs=40) |
66 | 76 | time_text.x = 65 |
67 | 77 | time_text.y = 120 |
68 | 78 | 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 | + |
69 | 86 | board.DISPLAY.show(time_text) |
| 87 | +# board.DISPLAY.show(text_group) # when running this line, the pyportal crashes |
70 | 88 |
|
71 | 89 | # Create an instance of the Adafruit IO REST client |
72 | 90 | io = RESTClient(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi) |
|
0 commit comments