|
13 | 13 | import pwmio |
14 | 14 |
|
15 | 15 | clue.display.brightness = 0.8 |
16 | | -clue_display = displayio.Group(max_size=4) |
| 16 | +clue_display = displayio.Group() |
17 | 17 |
|
18 | 18 | # draw the background image |
19 | | -wash_on_file = open("wash_on.bmp", "rb") |
| 19 | +WASH_ON_FILENAME = "wash_on.bmp" |
| 20 | + |
| 21 | +# CircuitPython 6 & 7 compatible |
| 22 | +wash_on_file = open(WASH_ON_FILENAME, "rb") |
20 | 23 | wash_on_bmp = displayio.OnDiskBitmap(wash_on_file) |
21 | | -wash_on_sprite = displayio.TileGrid(wash_on_bmp, pixel_shader=getattr(wash_on_bmp, 'pixel_shader', displayio.ColorConverter())) |
| 24 | +wash_on_sprite = displayio.TileGrid( |
| 25 | + wash_on_bmp, |
| 26 | + pixel_shader=getattr(wash_on_bmp, 'pixel_shader', displayio.ColorConverter()) |
| 27 | +) |
| 28 | + |
| 29 | +# # CircuitPython 7+ compatible |
| 30 | +# wash_on_bmp = displayio.OnDiskBitmap(WASH_ON_FILENAME) |
| 31 | +# wash_on_sprite = displayio.TileGrid(wash_on_bmp, pixel_shader=wash_on_bmp.pixel_shader) |
| 32 | + |
22 | 33 | clue_display.append(wash_on_sprite) |
23 | 34 |
|
24 | 35 | # draw the foreground image |
25 | | -wash_off_file = open("wash_off.bmp", "rb") |
| 36 | +WASH_OFF_FILENAME = "wash_off.bmp" |
| 37 | + |
| 38 | +# CircuitPython 6 & 7 compatible |
| 39 | +wash_off_file = open(WASH_OFF_FILENAME, "rb") |
26 | 40 | wash_off_bmp = displayio.OnDiskBitmap(wash_off_file) |
27 | | -wash_off_sprite = displayio.TileGrid(wash_off_bmp, pixel_shader=getattr(wash_off_bmp, 'pixel_shader', displayio.ColorConverter())) |
| 41 | +wash_off_sprite = displayio.TileGrid( |
| 42 | + wash_off_bmp, |
| 43 | + pixel_shader=getattr(wash_off_bmp, 'pixel_shader', displayio.ColorConverter()) |
| 44 | +) |
| 45 | + |
| 46 | +# # CircuitPython 7+ compatible |
| 47 | +# wash_off_bmp = displayio.OnDiskBitmap(WASH_OFF_FILENAME) |
| 48 | +# wash_off_sprite = displayio.TileGrid(wash_off_bmp, pixel_shader=wash_off_bmp.pixel_shader) |
| 49 | + |
28 | 50 | clue_display.append(wash_off_sprite) |
29 | 51 |
|
30 | 52 |
|
31 | 53 | # Create text |
32 | 54 | # first create the group |
33 | | -text_group = displayio.Group(max_size=5, scale=1) |
| 55 | +text_group = displayio.Group() |
34 | 56 | # Make a label |
35 | 57 | title_font = bitmap_font.load_font("/font/RacingSansOne-Regular-38.bdf") |
36 | 58 | title_font.load_glyphs("HandWashTimer".encode('utf-8')) |
|
50 | 72 |
|
51 | 73 | timer_font = bitmap_font.load_font("/font/RacingSansOne-Regular-29.bdf") |
52 | 74 | timer_font.load_glyphs("0123456789ADSWabcdefghijklmnopqrstuvwxyz:!".encode('utf-8')) |
53 | | -timer_label = label.Label(timer_font, text="Wave to start", color=0x4f3ab1, max_glyphs=15) |
| 75 | +timer_label = label.Label(timer_font, text="Wave to start", color=0x4f3ab1) |
54 | 76 | timer_label.x = 24 |
55 | 77 | timer_label.y = 100 |
56 | 78 | text_group.append(timer_label) |
|
0 commit comments