As is, the code has no pictures on the CIRCUITPY drive to use in your slideshow. Let's get some.
While the slideshow code is short and simple, know that microcontrollers, unlike computers, don't have the greatest amount of speed and memory. So any scaling of images and conversion of graphics formats should be done on your computer before they are copied to your device.
All images must be in .bmp format. There is no specific bitmap index (1, 4, 8) for such images.
The size of the image depends on the size of your display. Here are some dimensions, if there is a board without an entry, go to the Adafruit product page to see the specifications for the display and use those.
- PyPortal - 320x240 pixels (landscape)
- PyBadge and PyBadge LC - 160x128 pixels (landscape)
- PyGamer - 160x128 pixels (landscape)
- Hallowing M0 Express - 128x128 pixels (portrait)
- Monster M4sk and HalloWing M4 Express - 240x240 pixels (square)
The image editing software available is dependent on the operating system you are using. The GNU program GIMP runs on all operating systems and is free.
In your editing software, open the image you want in the slideshow. Resize the image to the dimensions for your device. Then save the image in BMP format in a folder on your computer.
The slideshow code is set to show the pictures in alphabetical order. It is suggested you save the pictures sequentially, re. the first one is saved as 001.bmp, the second as 002.bmp, etc., this will allow for 999 images you can display in order.
Copying the Pictures to Your Device
In your computer's file Explorer/Finder, create a new directory on your CIRCUITPY drive names images.
Go to the folder you copied your resized BMP images into and copy the files to your CIRCUITPY\images directory. Once done, the device should reset and run your slideshow!
Feel free to reorder your images by changing filenames, if necessary.
What happens when you use larger images than the display resolution? You'll see as much of the picture as the display can render, say 160x128 pixels out of a larger 320x240 picture. At this time, CircuitPython cannot change the resolutions of files for display. Perhaps one day.
These images are from Unsplash and come with an unlimited, free license.
Text editor powered by tinymce.