Skip to content

Commit 503a5dd

Browse files
authored
Merge pull request #42 from ritesh006/docs/readme-release-displays-before-spi
docs: call displayio.release_displays() before SPI init in README example (fixes #39)
2 parents 230cff0 + db6ab22 commit 503a5dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ Usage Example
3939
import fourwire
4040
import adafruit_ili9341
4141
42+
# If you use explicit pins with busio.SPI(...), calling release_displays() first
43+
# prevents "pin in use" errors on subsequent reloads.
44+
displayio.release_displays()
45+
4246
spi = board.SPI()
4347
tft_cs = board.D9
4448
tft_dc = board.D10
4549
46-
displayio.release_displays()
4750
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
4851
4952
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
@@ -57,8 +60,8 @@ Usage Example
5760
color_palette[0] = 0xFF0000
5861
5962
bg_sprite = displayio.TileGrid(color_bitmap,
60-
pixel_shader=color_palette,
61-
x=0, y=0)
63+
pixel_shader=color_palette,
64+
x=0, y=0)
6265
splash.append(bg_sprite)
6366
6467
while True:

0 commit comments

Comments
 (0)