File tree Expand file tree Collapse file tree 3 files changed +27
-22
lines changed
PiCowbell_HSTX_DVI_Examples Expand file tree Collapse file tree 3 files changed +27
-22
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
12# SPDX-FileCopyrightText: 2023 Liz Clark for Adafruit Industries
23# SPDX-FileCopyrightText: Adapted from Phil B.'s 16bit_hello Arduino Code
34#
1213import terminalio
1314import supervisor
1415import simpleio
16+ from setup_display import setup_display
1517from adafruit_bitmap_font import bitmap_font
1618from adafruit_display_text import label , wrap_text_to_lines
1719from adafruit_display_shapes .rect import Rect
2022from adafruit_display_shapes .triangle import Triangle
2123from adafruit_display_shapes .line import Line
2224
23- # see boot.py for display initialization
25+ setup_display ()
2426display = supervisor .runtime .display
2527
2628bitmap = displayio .Bitmap (display .width , display .height , 3 )
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
2+ #
3+ # SPDX-License-Identifier: MIT
4+ import supervisor
5+ import displayio
6+ import picodvi
7+ import framebufferio
8+ import board
9+
10+ def setup_display ():
11+ # Skip if the display is already initialized
12+ if supervisor .runtime .display is None :
13+ displayio .release_displays ()
14+ fb = picodvi .Framebuffer (320 , 240 ,
15+ clk_dp = board .GP14 , clk_dn = board .GP15 ,
16+ red_dp = board .GP12 , red_dn = board .GP13 ,
17+ green_dp = board .GP18 , green_dn = board .GP19 ,
18+ blue_dp = board .GP16 , blue_dn = board .GP17 ,
19+ color_depth = 8 )
20+ display = framebufferio .FramebufferDisplay (fb )
21+
22+ # set the display onto supervisor.runtime,
23+ # so it will be available to code.py
24+ supervisor .runtime .display = display
You can’t perform that action at this time.
0 commit comments