Skip to content

Added TFT Gizmo Slideshow Example for Slideshow Library #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions examples/slideshow_tft_gizmo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Slideshow Example using the CircuitPlayground and TFT Gizmo

Written by Melissa LeBlanc-Williams for Adafruit Industries
"""

import board
import digitalio
from adafruit_gizmo import tft_gizmo
from adafruit_slideshow import SlideShow, PlayBackDirection

display = tft_gizmo.TFT_Gizmo()

forward_button = digitalio.DigitalInOut(board.BUTTON_A)
forward_button.switch_to_input(pull=digitalio.Pull.DOWN)
back_button = digitalio.DigitalInOut(board.BUTTON_B)
back_button.switch_to_input(pull=digitalio.Pull.DOWN)

slideshow = SlideShow(display, None, folder="/",
auto_advance=False, dwell=0)

while True:
if forward_button.value:
slideshow.direction = PlayBackDirection.FORWARD
slideshow.advance()
if back_button.value:
slideshow.direction = PlayBackDirection.BACKWARD
slideshow.advance()