Skip to content

Commit 89fdf4f

Browse files
committed
Update to use fourwire and root_group for CP 9 compatibility
1 parent ce3f6d2 commit 89fdf4f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,21 @@ Usage Example
4444
4545
import board
4646
import displayio
47+
import fourwire
4748
from adafruit_st7735 import ST7735
4849
4950
spi = board.SPI()
5051
tft_cs = board.D5
5152
tft_dc = board.D6
5253
5354
displayio.release_displays()
54-
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
55+
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
5556
5657
display = ST7735(display_bus, width=128, height=128)
5758
5859
# Make the display context
5960
splash = displayio.Group()
60-
display.show(splash)
61+
display.root_group = splash
6162
6263
color_bitmap = displayio.Bitmap(128, 128, 1)
6364
color_palette = displayio.Palette(1)

examples/st7735_simpletest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import board
1010
import displayio
11+
import fourwire
1112
from adafruit_st7735 import ST7735
1213

1314
# Release any resources currently in use for the displays
@@ -17,15 +18,15 @@
1718
tft_cs = board.D5
1819
tft_dc = board.D6
1920

20-
display_bus = displayio.FourWire(
21+
display_bus = fourwire.FourWire(
2122
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
2223
)
2324

2425
display = ST7735(display_bus, width=128, height=128)
2526

2627
# Make the display context
2728
splash = displayio.Group()
28-
display.show(splash)
29+
display.root_group = splash
2930

3031
color_bitmap = displayio.Bitmap(128, 128, 1)
3132
color_palette = displayio.Palette(1)

0 commit comments

Comments
 (0)