Skip to content

Commit 1874283

Browse files
authored
Merge pull request #1755 from lesamouraipourpre/rbg-matrix
RBG Matrix: Update for CP7
2 parents 72a3182 + 028e1a7 commit 1874283

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

RBG_Matrix/code.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,24 @@
4646
display.show(g)
4747
display.auto_refresh = True
4848

49+
50+
# CircuitPython 6 & 7 compatible
4951
bitmap_file = open("/rbg.bmp", "rb")
5052
# Setup the file as the bitmap data source
5153
bitmap = displayio.OnDiskBitmap(bitmap_file)
5254
# Create a TileGrid to hold the bitmap
53-
tile_grid = displayio.TileGrid(bitmap, pixel_shader=getattr(bitmap, 'pixel_shader', displayio.ColorConverter()))
55+
tile_grid = displayio.TileGrid(
56+
bitmap,
57+
pixel_shader=getattr(bitmap, 'pixel_shader', displayio.ColorConverter())
58+
)
59+
60+
# # CircuitPython 7+ compatible
61+
# # Setup the filename as the bitmap data source
62+
# bitmap = displayio.OnDiskBitmap("/rbg.bmp")
63+
# # Create a TileGrid to hold the bitmap
64+
# tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)
65+
66+
5467
print(dir(tile_grid))
5568

5669
while True:

0 commit comments

Comments
 (0)