Your HalloWing is pre-loaded with a CircuitPython program that uses the Image SlideShow library.
If you need to re-download the files that were pre-loaded on your HalloWing, here's the repo.
Running a slideshow in CircuitPython on the HalloWing is dead easy! Here's the example code which automatically plays through all .bmp images in the /images
directory on the board.
Change from when this guide was first written
To make new slideshows, Adafruit suggests following this more recent slideshow guide:
Creating Slideshows in CircuitPython
That code uses an updated version of the SlideShow library using new display drivers using the CircuitPython DisplayIO
library. This makes it compatible with a wide range of displays.
This code is only left in to show you the code for the original Hackaday Badge. Pleas follow the guide link above to make more modern slide shows with the same ease.
import board from adafruit_slideshow import PlayBackOrder, SlideShow import pwmio # Create the slideshow object that plays through once alphabetically. slideshow = SlideShow(board.DISPLAY, pwmio.PWMOut(board.TFT_BACKLIGHT), folder="/images", loop=True, order=PlayBackOrder.ALPHABETICAL, dwell=2.5) while slideshow.update(): pass
Save it to the badge filesystem /images
folder as 24-bit Bitmap (*.bmp) and make sure the file name ends with .bmp as well
BMPs in Mac, Linux, etc.
There are several online image conversion websites which convert a file from one format to another. We'll show you one below but you can experiment with either other websites or Mac/Linux 3rd party image programs which may output BMP files.
We've used https://image.online-convert.com/convert-to-bmp to convert images to BMP format on the web. Take your 128x128 pixel color image file on your computer and drag/choose the file where indicated on the website.
Press the Start Conversion button below the file box.
If you need to tweak the settings, the site allows you options but it's best that you already have a color 128x128 pixel image to convert via the web.
When the conversion is done, a dialog should pop up in the browser to say where would you like to save the file (now converted with a .bmp file name extension).
Now you have a BMP file! To load onto your HalloWing, use your finder or linux file manager. Plug in your HalloWing to your computer via a good data USB cable. The board should show up as a flash drive named CIRCUITPY. Now copy the BMP into the directory on CIRCUITPY named /images. There you go, done!. You can go into the images directory and add / change / delete BMPs as you wish.
Text editor powered by tinymce.