code.py
1 # SPDX-FileCopyrightText: 2019 Carter Nelson for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 import board 6 import displayio 7 import adafruit_imageload 8 9 display = board.DISPLAY 10 11 bitmap, palette = adafruit_imageload.load("/purple.bmp", 12 bitmap=displayio.Bitmap, 13 palette=displayio.Palette) 14 15 # Create a TileGrid to hold the bitmap 16 tile_grid = displayio.TileGrid(bitmap, pixel_shader=palette) 17 18 # Create a Group to hold the TileGrid 19 group = displayio.Group() 20 21 # Add the TileGrid to the Group 22 group.append(tile_grid) 23 24 # Add the Group to the Display 25 display.show(group) 26 27 # Loop forever so you can enjoy your image 28 while True: 29 pass