File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
CircuitPython_gifio/Feather Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 5
5
# Play Multiple GIF files on a n ESP32-S2 Feather TFT
6
6
# Requires CircuitPython 8.1.0-beta.1 or later
7
7
# Updated 4/4/2023
8
+
9
+ import time
10
+ import gc
8
11
import os
9
12
import struct
10
13
import board
11
14
import gifio
12
15
import digitalio
13
- import time
14
- import gc
15
16
16
17
# Get a dictionary of GIF filenames at the passed base directory
17
18
def get_files (base ):
18
- files = os .listdir (base )
19
+ allfiles = os .listdir (base )
19
20
file_names = []
20
- for j , filetext in enumerate (files ):
21
+ for _ , filetext in enumerate (allfiles ):
21
22
if not filetext .startswith ("." ):
22
23
if filetext not in ('boot_out.txt' , 'System Volume Information' ):
23
24
if filetext .endswith (".gif" ):
@@ -41,7 +42,7 @@ def get_files(base):
41
42
# Skip PyPortal GIFs if put on ESP32-S2 Feather TFT
42
43
if odg .width != board .DISPLAY .width :
43
44
print ("File " + files [i ]+ " not right width, skipping\n " )
44
- pass
45
+ continue
45
46
46
47
start = time .monotonic ()
47
48
next_delay = odg .next_frame () # Load the first frame
You can’t perform that action at this time.
0 commit comments