The Adafruit MacroPad comes with a built in display. The MacroPad library makes it super simple to display a CircuitPython-compatible bitmap image on the display. To learn more about how to create a CircuitPython-compatible bitmap, check out this guide - the difference here is, the MacroPad display is monochrome, so you'll want a black and white image.
You can easily update the code to use any compatible bitmap you'd like, but for this example, use the image included below.
Installing Project Code
CIRCUITPY drive. Then you need to update code.py
Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, open the directory examples/macropad_display_image/ and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your CIRCUITPY drive.
Your CIRCUITPY
# SPDX-FileCopyrightText: Copyright (c) 2021 Kattni Rembor for Adafruit Industries # # SPDX-License-Identifier: Unlicense """ MacroPad display image demo. Displays a bitmap image on the built-in display. """ from adafruit_macropad import MacroPad macropad = MacroPad() macropad.display_image("blinka.bmp") while True: pass
Check out the display!
To use the display_image
feature of the MacroPad library, you import and instantiate the library as usual, and then include macropad.display_image("image_name.bmp")
in your code, where image_name
is the name of your bitmap image.
In this example, you import and instantiate the MacroPad library.
Then, you include macropad.display_image("blinka.bmp")
.
Inside the loop, you simply include a pass
.
That's all there is to displaying a CircuitPython-compatible bitmap image on the built-in display of the Adafruit MacroPad using the CircuitPython MacroPad library!
Text editor powered by tinymce.