Skip to content

Commit 8783fa7

Browse files
committed
vertical garden barometer cp7 updates
1 parent bd7536a commit 8783fa7

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Vertical_Garden_Barometer/code.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,42 +54,54 @@
5454
button_a_pressed = False
5555

5656
clue.display.brightness = 0.8
57-
clue_display = displayio.Group(max_size=4)
57+
clue_display = displayio.Group()
5858

5959
# draw the rising image
60+
# CircuitPython 6 & 7 compatible
6061
rising_file = open("rising.bmp", "rb")
6162
rising_bmp = displayio.OnDiskBitmap(rising_file)
6263
rising_sprite = displayio.TileGrid(rising_bmp, pixel_shader=getattr(rising_bmp, 'pixel_shader', displayio.ColorConverter()))
64+
65+
# # CircuitPython 7+ compatible
66+
# rising_bmp = displayio.OnDiskBitmap("rising.bmp")
67+
# rising_sprite = displayio.TileGrid(rising_bmp, pixel_shader=rising_bmp.pixel_shader)
68+
6369
clue_display.append(rising_sprite)
6470

6571
# draw the sinking image
72+
# CircuitPython 6 & 7 compatible
6673
sinking_file = open("sinking.bmp", "rb")
6774
sinking_bmp = displayio.OnDiskBitmap(sinking_file)
6875
sinking_sprite = displayio.TileGrid(sinking_bmp, pixel_shader=getattr(sinking_bmp, 'pixel_shader', displayio.ColorConverter()))
76+
77+
# # CircuitPython 7+ compatible
78+
# sinking_bmp = displayio.OnDiskBitmap("sinking.bmp")
79+
# sinking_sprite = displayio.TileGrid(sinking_bmp, pixel_shader=sinking_bmp.pixel_shader)
80+
6981
clue_display.append(sinking_sprite)
7082

7183
# Create text
7284
# first create the group
73-
text_group = displayio.Group(max_size=5, scale=1)
85+
text_group = displayio.Group()
7486
# Make a label
7587
reading_font = bitmap_font.load_font("/font/RacingSansOne-Regular-29.bdf")
7688
reading_font.load_glyphs("0123456789ADSWabcdefghijklmnopqrstuvwxyz:!".encode('utf-8'))
77-
reading_label = label.Label(reading_font, color=0xffffff, max_glyphs=15)
89+
reading_label = label.Label(reading_font, color=0xffffff)
7890
reading_label.x = 10
7991
reading_label.y = 24
8092
text_group.append(reading_label)
8193

82-
reading2_label = label.Label(reading_font, color=0xdaf5f4, max_glyphs=15)
94+
reading2_label = label.Label(reading_font, color=0xdaf5f4)
8395
reading2_label.x = 10
8496
reading2_label.y = 54
8597
text_group.append(reading2_label)
8698

87-
reading3_label = label.Label(reading_font, color=0x4f3ab1, max_glyphs=15)
99+
reading3_label = label.Label(reading_font, color=0x4f3ab1)
88100
reading3_label.x = 10
89101
reading3_label.y = 84
90102
text_group.append(reading3_label)
91103

92-
timer_label = label.Label(reading_font, color=0x072170, max_glyphs=15)
104+
timer_label = label.Label(reading_font, color=0x072170)
93105
timer_label.x = 10
94106
timer_label.y = 114
95107
text_group.append(timer_label)

0 commit comments

Comments
 (0)