2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
#
5
- # Play Multiple GIF files on a n ESP32-S2 Feather TFT
5
+ # Play Multiple GIF files on an ESP32-S2 Feather TFT
6
6
# Requires CircuitPython 8.1.0-beta.1 or later
7
7
# Updated 4/4/2023
8
8
@@ -30,10 +30,10 @@ def get_files(base):
30
30
button .switch_to_input (pull = digitalio .Pull .UP )
31
31
32
32
display = board .DISPLAY
33
-
34
- # Take over display to drive directly
35
33
display .auto_refresh = False
36
- display_bus = display .bus
34
+
35
+ COL_OFFSET = 40 # The Feather TFT needs to have the display
36
+ ROW_OFFSET = 53 # offset by these values for direct writes
37
37
38
38
files = get_files ("/" )
39
39
for i in range (len (files )):
@@ -58,9 +58,11 @@ def get_files(base):
58
58
print ("Button Press, Advance\n " )
59
59
break
60
60
next_delay = odg .next_frame ()
61
- display_bus .send (42 , struct .pack (">hh" , 0 , odg .bitmap .width - 1 ))
62
- display_bus .send (43 , struct .pack (">hh" , 0 , odg .bitmap .height - 1 ))
63
- display_bus .send (44 , odg .bitmap )
61
+ display .bus .send (42 , struct .pack (">hh" , COL_OFFSET ,
62
+ odg .bitmap .width - 1 + COL_OFFSET ))
63
+ display .bus .send (43 , struct .pack (">hh" , ROW_OFFSET ,
64
+ odg .bitmap .height - 1 + ROW_OFFSET ))
65
+ display .bus .send (44 , odg .bitmap )
64
66
# End while
65
67
# Clean up memory
66
68
odg .deinit ()
0 commit comments