Total dirty hack, but I'm not up for clearing displayio.Group()s yet to reclaim memory - or even know enough to know whether I need to (working on it!). This hack loads all the EYE_DATA files at the same time, adding them to a list. Turns out there's plenty of memory for that. Every time the Matrix Portal resets, it chooses one at random. Next I added (here's the dirty part) a timed supervisor.reload() like this:
Code: Select all
if NOW - SWAP > 120:
supervisor.reload()
The main program is attached here. You'll need the full Creatures Eyes downloaded to your Matrix Portal, then use this file to overwrite code.py (or main.py, or...). Here's the link to the Learn page: https://learn.adafruit.com/matrix-portal-creature-eyes