Update code-multi-pyportal-direct.py

This commit is contained in:
Anne Barela 2023-04-05 12:08:28 -04:00 committed by GitHub
parent 17f9688420
commit 35dd446cc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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