Update code-multi-pyportal-direct.py
This commit is contained in:
parent
17f9688420
commit
35dd446cc1
1 changed files with 5 additions and 4 deletions
|
|
@ -5,19 +5,20 @@
|
|||
# Play Multiple GIF files on a PyPortal
|
||||
# Requires CircuitPython 8.1.0-beta.1 or later
|
||||
# Updated 4/4/2023
|
||||
|
||||
import time
|
||||
import gc
|
||||
import os
|
||||
import struct
|
||||
import board
|
||||
import gifio
|
||||
import time
|
||||
import adafruit_touchscreen
|
||||
import gc
|
||||
|
||||
# Get a dictionary of GIF filenames at the passed base directory
|
||||
def get_files(base):
|
||||
files = os.listdir(base)
|
||||
file_names = []
|
||||
for j, filetext in enumerate(files):
|
||||
for _, filetext in enumerate(files):
|
||||
if not filetext.startswith("."):
|
||||
if filetext not in ('boot_out.txt', 'System Volume Information'):
|
||||
if filetext.endswith(".gif"):
|
||||
|
|
@ -44,7 +45,7 @@ for i in range(len(files)):
|
|||
# Skip Feather GIFs if put on PyPortal
|
||||
if odg.width != WIDTH:
|
||||
print("File "+files[i]+" not right width, skipping\n")
|
||||
pass
|
||||
continue
|
||||
|
||||
start = time.monotonic()
|
||||
next_delay = odg.next_frame() # Load the first frame
|
||||
|
|
|
|||
Loading…
Reference in a new issue