diff --git a/examples/imageload_magtag_simpletest.py b/examples/imageload_magtag_simpletest.py new file mode 100644 index 0000000..d95e4e7 --- /dev/null +++ b/examples/imageload_magtag_simpletest.py @@ -0,0 +1,31 @@ +""" +Basic imageload example script +adapted for use on MagTag. +""" +import time +import board +import displayio +import adafruit_imageload + +# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.) +# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.) +# https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus +display = board.DISPLAY + +# wait until the display is ready +time.sleep(display.time_to_refresh) + +image, palette = adafruit_imageload.load("images/magtag_2x2_test.bmp") + +tile_grid = displayio.TileGrid(image, pixel_shader=palette) + +# scale 8 for full screen +group = displayio.Group(scale=8) +group.append(tile_grid) + +# show the group and refresh +display.show(group) +display.refresh() + +while True: + pass diff --git a/examples/images/magtag_2x2_test.bmp b/examples/images/magtag_2x2_test.bmp new file mode 100644 index 0000000..bae23f7 Binary files /dev/null and b/examples/images/magtag_2x2_test.bmp differ diff --git a/examples/images/magtag_2x2_test.bmp.license b/examples/images/magtag_2x2_test.bmp.license new file mode 100644 index 0000000..4db0b86 --- /dev/null +++ b/examples/images/magtag_2x2_test.bmp.license @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2020 Foamyguy +# +# SPDX-License-Identifier: Unlicense \ No newline at end of file