Your board will need two code files to work:
- A library containing the slideshow code
- Your program, named code.py, which calls the slideshow library
All of the nitty-gritty is coded in the library, making working with the code super simple.
Download the Library
On the previous page you did note the version of CircuitPython you downloaded, yes?
Good. Go to CircuitPython.Org/libraries and you'll look to download the library bundle matching the major version of CircuitPython you installed.
Save the file to your computer (not on the CIRCUITPY drive, please).
For this project, only one library file is needed!
Ensure your board is connected to your computer via a known good USB cable. Use your operating system file explorer/finder to go to the CIRCUITPY drive. Create a new folder named lib. We'll put the library we need in this folder.
Now use your file explorer/finder to go to where you saved the library bundle zip file. Open the file and find the file named adafruit_slideshow.mpy. Copy that file into the lib folder on the CIRCUITPY drive you just made. Now you're set.
Get the Code!
The code for the project is below. Click any of the save options and save to your computer. The file you want is named code.py, the default run name for CircuitPython code on a CircuitPython device.
# SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries # # SPDX-License-Identifier: MIT # CircuitPython Slideshow - uses the adafruit_slideshow.mpy library import board from adafruit_slideshow import PlayBackOrder, SlideShow # Create the slideshow object that plays through once alphabetically. slideshow = SlideShow(board.DISPLAY, folder="/images", loop=True, order=PlayBackOrder.ALPHABETICAL, dwell=60) while slideshow.update(): pass
That's it - rather short, yes? Adafruit has made the library do all the heavy lifting.
There are customizations that may be done, they will be explored after getting pictures displaying on the screen.
Page last edited January 22, 2025
Text editor powered by tinymce.