From 1c0dcd17fff3ed05fff845d331a76260ba360ddc Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 14 Feb 2020 16:02:40 -0500 Subject: [PATCH] Add slideshow example. --- examples/clue_slideshow.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 examples/clue_slideshow.py diff --git a/examples/clue_slideshow.py b/examples/clue_slideshow.py new file mode 100755 index 0000000..25f1e08 --- /dev/null +++ b/examples/clue_slideshow.py @@ -0,0 +1,18 @@ +"""Display a series of bitmaps using the buttons to advance through the list. To use: place +supported bitmap files on your CIRCUITPY drive, then press the buttons on your CLUE to advance +through them. + +Requires the Adafruit CircuitPython Slideshow library!""" + +from adafruit_clue import clue +from adafruit_slideshow import SlideShow, PlayBackDirection + +slideshow = SlideShow(clue.display, None, folder="/", auto_advance=False, dwell=0) + +while True: + if clue.button_b: + slideshow.direction = PlayBackDirection.FORWARD + slideshow.advance() + if clue.button_a: + slideshow.direction = PlayBackDirection.BACKWARD + slideshow.advance()