Skip to content

Commit 0dc0608

Browse files
committed
updated 1.47" screen simple test with Pico compatability and using busio for creating the SPI interface
1 parent 2b22b10 commit 0dc0608

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

examples/st7789_172x320_1.47_simpletest.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,21 @@
1818
# Release any resources currently in use for the displays
1919
displayio.release_displays()
2020

21-
tft_cs = board.GP5 # board.D5
22-
tft_dc = board.GP6 # board.D6
23-
tft_rst = board.GP7 # board.D7
21+
# built-in, silkscreen labelled SPI bus
22+
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
23+
tft_cs = board.D5
24+
tft_dc = board.D6
25+
tft_rst = board.D9
26+
27+
# If using a Raspberry Pi Pico or Pico-w
28+
# Uncomment the below code to use GP (General Purpose) pins
29+
# instead of D (Digital)
30+
31+
# spi = busio.SPI(board.GP2, board.GP3, board.GP4)
32+
# tft_cs = board.GP5
33+
# tft_dc = board.GP6
34+
# tft_rst = board.GP7
2435

25-
spi = busio.SPI(board.GP2, board.GP3, board.GP4)
2636
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_rst)
2737

2838
display = ST7789(display_bus, width=320, height=172, colstart=34, rotation=270)

0 commit comments

Comments
 (0)