-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from makermelissa/master
Added TFT Gizmo Slideshow Example for Slideshow Library
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |