Skip to content

Commit 5ace47a

Browse files
authored
Update code-multi-feather-direct.py
1 parent 5cabdec commit 5ace47a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CircuitPython_gifio/Feather/code-multi-feather-direct.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
# Play Multiple GIF files on a n ESP32-S2 Feather TFT
66
# Requires CircuitPython 8.1.0-beta.1 or later
77
# Updated 4/4/2023
8+
9+
import time
10+
import gc
811
import os
912
import struct
1013
import board
1114
import gifio
1215
import digitalio
13-
import time
14-
import gc
1516

1617
# Get a dictionary of GIF filenames at the passed base directory
1718
def get_files(base):
18-
files = os.listdir(base)
19+
allfiles = os.listdir(base)
1920
file_names = []
20-
for j, filetext in enumerate(files):
21+
for _, filetext in enumerate(allfiles):
2122
if not filetext.startswith("."):
2223
if filetext not in ('boot_out.txt', 'System Volume Information'):
2324
if filetext.endswith(".gif"):
@@ -41,7 +42,7 @@ def get_files(base):
4142
# Skip PyPortal GIFs if put on ESP32-S2 Feather TFT
4243
if odg.width != board.DISPLAY.width:
4344
print("File "+files[i]+" not right width, skipping\n")
44-
pass
45+
continue
4546

4647
start = time.monotonic()
4748
next_delay = odg.next_frame() # Load the first frame

0 commit comments

Comments
 (0)