Inky Frame slide show

I wrote a very basic slide show program in MicroPython for the Inky Frame so I could preload them with some images to make them a better gift. It just shows every (600x448) JPEG in the /slides directory on the SD card in a loop:

1 Like

Thank you for sharing. I don’t own an inky, so I can’t try it. But I like when people share there code so thumbs up from me. =)

I wrote that quickly in late July just after my Inky Frames turned up. Pimoroni posted a more elaborate example while I was on holiday: Pimoroni MicroPython Examples: Inky Frame: Image Gallery.

I needed a retry loop for mounting the SD card at power up. It’s fine afterwards but my code throws an OSError if I don’t have something like this in there.

sd = None
last_exception = None
### First one often fails at power up
for _ in range(15):
        sd = sdcard.SDCard(sd_spi, Pin(22))
        uos.mount(sd, SD_MOUNTPOINT)
    except OSError as ex:
        last_exception = ex
if sd is None:
    raise last_exception

Perhaps there’s a better way to achieve the same thing there?

Oh, and I know I’m not necessarily handling uos.mount errors well.

I have a Pico RGB Keypad running Circuit Python. It’s set up as a USB HID device. It errors out waiting for my Windows PC to boot up. I ended up putting a time.sleep as my first statement in my while true loop. My code doesn’t run until the PC is booted up and waiting at the log in screen. I know the keypad is ready when all the pads light up a dim white.
Long story made short, It’s not an elegant or sophisticated solution, but it works. ;)

I just updated the code. It now has:

  • sleep support on battery power with next image every 4 hours (possibly a bit less on my Inky Frame as my clock appears to run fast),
  • buttons for navigation and
  • an introduction/instructions screen currently implemented as a JPEG image (see below).