This project uses a Raspberry Pi Pico WH with a Pimoroni Display Pack 2.0 to display looping image sequences. The images are served from a FastAPI backend running in a Docker container. The Pico fetches images over WiFi and randomly selects a scene to display. Pressing and holding the X button will trigger a new random scene selection.
- Raspberry Pi Pico WH (WiFi-enabled)
- Pimoroni Display Pack 2.0
- MicroPython (Pimoroni firmware for the Display Pack)
- Docker (for running the FastAPI server)
- FastAPI (to serve image sequences)
- Build the Docker image using the provided
Dockerfile:docker build -t fastapi-scenes . - Create a
scenesdirectory and add subdirectories named after different scenes. - Place PNG images inside these scene directories.
- Images must be in
.pngformat. - Each image should not exceed 40kB in size.
- Images must be in
- Run the FastAPI container:
docker run -d -p 8000:8000 -v $(pwd)/scenes:/app/scenes fastapi-scenes - Note the IP address of the machine running the container, as you will need it for the Pico setup.
- Install Pimoroni MicroPython Firmware on your Pico. You can download it from the Pimoroni website.
- Copy the contents of
pico_lcd/onto your Pico. - Configure WiFi: Edit
WIFI_CONFIGin the code to match your network settings. - Set FastAPI Server URL: Adjust
BASE_URLto point to the IP and port of the FastAPI container.
- The Pico randomly selects a scene from your
scenesdirectory. - It displays all images inside the selected scene sequentially.
- Once finished, it randomly selects a new scene (which can be the same as the previous one).
- Holding the X Button forces an early random scene selection.
- Designed for smooth animations (no extra delay between frames).
- Optional Picture Frame Mode: Uncomment the
time.sleep()line at the end of the scene loop to introduce a delay between frames, making it function more like a digital picture frame.
This project is open-source under the MIT License.