Skip to content

Commit 3e96de0

Browse files
committed
Update DVI examples
Move display2 to Example 1 (can cause funky behavior in example 2) Fix camera using the correct buffer
1 parent 34cd8ee commit 3e96de0

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

red_vision_examples/dvi_examples/ex01_hello_dvi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,19 @@
105105
if display._buffer_is_in_psram:
106106
import gc
107107
gc.collect()
108+
109+
# If the ST7789 display is also connected, it can be controlled independently
110+
# of the DVI display. For example, we can show a splash screen on it:
111+
from red_vision.displays import st7789_pio
112+
spi = machine.SPI(baudrate=24_000_000)
113+
display2 = st7789_pio.ST7789_PIO(
114+
width = 240,
115+
height = 320,
116+
sm_id = 4,
117+
pin_clk = 22,
118+
pin_tx = 23,
119+
pin_dc = 20,
120+
pin_cs = 21,
121+
rotation = 1
122+
)
123+
display2.splash("red_vision_examples/images/splash.png")

red_vision_examples/dvi_examples/ex02_high_fps_camera.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,10 @@
7878
pin_pclk = 40,
7979
pin_xclk = 44, # Optional xclock pin, specify if needed
8080
xclk_freq = 20_000_000,
81-
buffer = display._buffer,
81+
buffer = buffer,
8282
continuous = True,
8383
)
8484

8585
# Open the camera to start the continuous capture process.
8686
camera.open()
8787
camera._capture()
88-
89-
# If the ST7789 display is also connected, it can be controlled independently
90-
# of the DVI display. For example, we can show a splash screen on it:
91-
from red_vision.displays import st7789_pio
92-
spi = machine.SPI(baudrate=24_000_000)
93-
display2 = st7789_pio.ST7789_PIO(
94-
width = 240,
95-
height = 320,
96-
sm_id = 4,
97-
pin_clk = 22,
98-
pin_tx = 23,
99-
pin_dc = 20,
100-
pin_cs = 21,
101-
rotation = 1
102-
)
103-
display2.splash("red_vision_examples/images/splash.png")

0 commit comments

Comments
 (0)