# Inky Frame slide show

**URL:** <https://forums.pimoroni.com/t/inky-frame-slide-show/19996>\
**Category:** Projects\
**Created:** [August 8, 2022, 8:22pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996 "2022-08-08T20:22:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [August 8, 2022, 8:22pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/1 "2022-08-08T20:22:07Z")

</div>

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: [sdslideshow.py](https://github.com/kevinjwalters/micropython-examples/blob/master/pico-w/sdslideshow.py).

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 8, 2022, 11:51pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/2 "2022-08-08T23:51:35Z")

</div>

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. =)

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [August 11, 2022, 10:29pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/3 "2022-08-11T22:29:46Z")

</div>

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](https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/inky_frame/image_gallery).

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [August 16, 2022, 8:01pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/4 "2022-08-16T20:01:11Z")

</div>

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.

```auto
sd = None
last_exception = None
### First one often fails at power up
for _ in range(15):
    try:
        sd = sdcard.SDCard(sd_spi, Pin(22))
        uos.mount(sd, SD_MOUNTPOINT)
        break
    except OSError as ex:
        last_exception = ex
    time.sleep(4)
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.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [August 17, 2022, 7:55am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/5 "2022-08-17T07:55:23Z")

</div>

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. ;)

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [August 22, 2022, 10:24pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/6 "2022-08-22T22:24:10Z")

</div>

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).

![introduction](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/7/75fb7a9a26db74ead8d3f04a9e3ce1727ef97427.jpeg)

---

<div class="post-metadata">

**Author:** ![ingurum](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ingurum](https://forums.pimoroni.com/u/ingurum)\
**Post date:** [November 5, 2022, 4:33pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/7 "2022-11-05T16:33:11Z")

</div>

This is cool! I tried to do this aswell, sadly I think the ram prevents me from running this with 3k images on the sdcard:  
Traceback (most recent call last):  
File “”, line 158, in   
MemoryError: memory allocation failed, allocating 8192 bytes

at:  
files = list(filter(JPEG\_RE.search, uos.listdir(SLIDE\_DIR)))

How many images do you have on the sd?

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [November 5, 2022, 10:30pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/8 "2022-11-05T22:30:25Z")

</div>

I’ve been giving them away as gifts with 10-50 images on, nowhere near 3000!

It turns out there’s an `uos.ilistdir` function which is an `iterator` and that makes it possible to read the directory without loading large chunks of FAT32 directory content into memory. I’ve just re-coded my slide show to use that. I don’t have time at the moment to setup a test with a large number of images but you’re welcome to have a play with it. Same location on github, it’s `v1.6` in the code comments.

---

<div class="post-metadata">

**Author:** ![ingurum](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ingurum](https://forums.pimoroni.com/u/ingurum)\
**Post date:** [November 8, 2022, 10:07pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/9 "2022-11-08T22:07:17Z")

</div>

jup that works! thank you!

 ![20221108_231011](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/2/24dd6d03929e026ebf5b52f975c571fcf6bcfcf8.jpeg)

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [November 10, 2022, 10:50am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/10 "2022-11-10T10:50:18Z")

</div>

Nice. You printed that frame yourself? Do you share it somewhere?

---

<div class="post-metadata">

**Author:** ![ingurum](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ingurum](https://forums.pimoroni.com/u/ingurum)\
**Post date:** [November 10, 2022, 7:00pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/11 "2022-11-10T19:00:17Z")

</div>

Sure: [Printables](https://www.printables.com/model/314493-inky-frame-case)

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [November 11, 2022, 6:39am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/12 "2022-11-11T06:39:33Z")

</div>

Thanks for sharing. I already downloaded it and I will give it a try. Since I own a MKS3+, I expect no problems.

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [December 8, 2022, 12:51am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/13 "2022-12-08T00:51:20Z")

</div>

Glad it worked. The frame looks really nice. Does that have room for AA batteries or are you using something slimmer?

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [December 9, 2022, 12:28am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/14 "2022-12-09T00:28:45Z")

</div>

I wrote [Instructables: Battery-Powered Digital Picture Frame Using Pimoroni Inky Frame](https://www.instructables.com/Battery-Powered-Digital-Picture-Frame-Using-Pimoro/) for a bit more detail on using the slide show program including a bit of power profiling with Nordic Power Profiler Kit II. I mentioned @ingurum 3D-printed frame as it looks really good. I don’t have a printer to try it out myself.

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [December 9, 2022, 7:46am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/15 "2022-12-09T07:46:19Z")

</div>

Very good writeup!

Judging from the PPK2-graph, the wlan-part of the pico is active. These spikes at 150mA suggest activity from the radio. Also, a normal pico needs something like 25mA while active, and the difference to 50mA is probably not due to the inky.

So it would be interesting if there is a means of shutting down the radio or maybe even starting with a deactivated radio. The wlan-chip on the picow does have the necessary interfaces, but I’m not sure if they are exposed by MicroPython.

---

<div class="post-metadata">

**Author:** ![ingurum](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ingurum](https://forums.pimoroni.com/u/ingurum)\
**Post date:** [December 9, 2022, 11:48am UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/16 "2022-12-09T11:48:42Z")

</div>

Great instructable kevin!

I used a lipo and I am working on V2 for the case to include an amigo pro for charging. Also I’ll deepen the case for the included AA batteries. I am planning to improve the snapfit as well (maybe screws)

 ![20221209_095511](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/2/2877fd6a836bde8c3377cfba9003a70969da1550.jpeg)

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [December 10, 2022, 5:34pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/18 "2022-12-10T17:34:36Z")

</div>

Could be directory naming, you mentioned slide but program looks for slides (plural)?

---

<div class="post-metadata">

**Author:** ![Equinoxe](https://avatars.discourse-cdn.com/v4/letter/e/ad7895/32.png) [@Equinoxe](https://forums.pimoroni.com/u/Equinoxe)\
**Post date:** [December 10, 2022, 5:52pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/19 "2022-12-10T17:52:33Z")

</div>

I just checked the SD card and it was empty. Not sure how the directory got deleted,but that solved the loading problem. I am not getting any lights from buttons interaction. Is that normal ?  
The introduction.jpg must be on the root of sd card?  
SLIDE\_INTROFILE = SD\_MOUNTPOINT + “/introduction.jpg”

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forums.pimoroni.com/u/kjw)\
**Post date:** [December 10, 2022, 7:31pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/20 "2022-12-10T19:31:01Z")

</div>

Yes, root directory for the introduction.jpg. There’s an image of layout in step 3 of [https://www.instructables.com/Battery-Powered-Digital-Picture-Frame-Using-Pimoro/](https://www.instructables.com/Battery-Powered-Digital-Picture-Frame-Using-Pimoro/)

There’s no current use of LEDs but it’s on todo list. It would useful to indicate button presses as Inky Frame (using MicroPython?) requires an unusually long press to wake.

---

<div class="post-metadata">

**Author:** ![Equinoxe](https://avatars.discourse-cdn.com/v4/letter/e/ad7895/32.png) [@Equinoxe](https://forums.pimoroni.com/u/Equinoxe)\
**Post date:** [December 10, 2022, 7:58pm UTC](https://forums.pimoroni.com/t/inky-frame-slide-show/19996/21 "2022-12-10T19:58:45Z")

</div>

Thanks again for the script and the replies. It works good now.  
I appreciate the effort you put into it and the fact that you made it so easy to understand.

[Next page](https://forums.pimoroni.com/t/inky-frame-slide-show/19996.md?page=2)
