From db6ab223808b14cd7fb16240819c790fc24d2a53 Mon Sep 17 00:00:00 2001 From: ritesh006 Date: Wed, 27 Aug 2025 12:36:44 +0530 Subject: [PATCH] docs: call displayio.release_displays() before SPI init in README example Fixes #39. Also note why: avoids 'pin in use' errors on subsequent reloads when using explicit SPI pins. --- README.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index c0e174c..6595940 100644 --- a/README.rst +++ b/README.rst @@ -39,11 +39,14 @@ Usage Example import fourwire import adafruit_ili9341 + # If you use explicit pins with busio.SPI(...), calling release_displays() first + # prevents "pin in use" errors on subsequent reloads. + displayio.release_displays() + spi = board.SPI() tft_cs = board.D9 tft_dc = board.D10 - displayio.release_displays() display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs) display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240) @@ -57,8 +60,8 @@ Usage Example color_palette[0] = 0xFF0000 bg_sprite = displayio.TileGrid(color_bitmap, - pixel_shader=color_palette, - x=0, y=0) + pixel_shader=color_palette, + x=0, y=0) splash.append(bg_sprite) while True: