Skip to content

Commit a2e7224

Browse files
committed
update display init for current released version
1 parent 2e54a02 commit a2e7224

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

Metro/Metro_RP2350_Snake/code.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import sys
44
import time
55
from micropython import const
6+
import board
7+
import picodvi
8+
import framebufferio
69
import supervisor
710
import displayio
811
import terminalio
@@ -31,8 +34,26 @@
3134
# variable for the players score
3235
score = 0
3336

34-
# default HSTX display gets initialized by default by circuitpython
35-
display = supervisor.runtime.display
37+
# initialize display
38+
displayio.release_displays()
39+
fb = picodvi.Framebuffer(
40+
320,
41+
240,
42+
clk_dp=board.CKP,
43+
clk_dn=board.CKN,
44+
red_dp=board.D0P,
45+
red_dn=board.D0N,
46+
green_dp=board.D1P,
47+
green_dn=board.D1N,
48+
blue_dp=board.D2P,
49+
blue_dn=board.D2N,
50+
color_depth=16,
51+
)
52+
display = framebufferio.FramebufferDisplay(fb)
53+
54+
# In future release the default HSTX display
55+
# will get initialized by default by circuitpython
56+
# display = supervisor.runtime.display
3657

3758
# load title splash screen bitmap
3859
title_bmp = displayio.OnDiskBitmap("snake_splash.bmp")

0 commit comments

Comments
 (0)