Skip to content

Commit 8b98132

Browse files
committed
Add splash screen support to boot.py
1 parent 8696ea7 commit 8b98132

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

examples/boot.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@
5454
# minimize latency
5555
spi.init(baudrate=24_000_000)
5656

57-
# Clear the display to wipe any previous content. This is optional, but it's
58-
# recommended to ensure a clean slate
59-
if hasattr(display, 'clear'):
60-
display.clear()
57+
# Attempt to put something on the display to clear the previous content
58+
try:
59+
# Load and display a splash image, if it's available
60+
import cv2
61+
splash_image = cv2.imread("splash.png")
62+
cv2.imshow(display, splash_image)
63+
except Exception:
64+
# Clear the display, if the driver supports it
65+
if hasattr(display, 'clear'):
66+
display.clear()

0 commit comments

Comments
 (0)