Skip to content

Commit

Permalink
Merge pull request #32 from prcutler/root-group-fix
Browse files Browse the repository at this point in the history
Update to use fourwire and root_group for CP 9 compatibility
  • Loading branch information
dhalbert authored Nov 3, 2023
2 parents 586e76d + 927416d commit 8c34ad9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ Usage Example
import board
import displayio
import fourwire
from adafruit_st7735r import ST7735R
spi = board.SPI()
tft_cs = board.D5
tft_dc = board.D6
displayio.release_displays()
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
display = ST7735R(display_bus, width=128, height=128, colstart=2, rowstart=1)
# Make the display context
splash = displayio.Group()
display.show(splash)
color_bitmap = displayio.Bitmap(128, 128, 1)
color_palette = displayio.Palette(1)
Expand Down
7 changes: 3 additions & 4 deletions examples/st7735r_128x160_colored_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_st7735r import ST7735R

Expand All @@ -19,17 +20,15 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)

display = ST7735R(
display_bus, width=160, height=80, colstart=24, rotation=270, bgr=False
)

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(160, 80, 1)
color_palette = displayio.Palette(1)
Expand Down
7 changes: 3 additions & 4 deletions examples/st7735r_128x160_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_st7735r import ST7735R

Expand All @@ -19,15 +20,13 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)

display = ST7735R(display_bus, width=160, height=128, rotation=90, bgr=True)

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(160, 128, 1)
color_palette = displayio.Palette(1)
Expand Down
3 changes: 2 additions & 1 deletion examples/st7735r_18tftshield_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import board
import displayio
import fourwire
from adafruit_seesaw.tftshield18 import TFTShield18
from adafruit_st7735r import ST7735R

Expand All @@ -19,7 +20,7 @@
tft_cs = board.D10
tft_dc = board.D8

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)

ss.tft_reset()
display = ST7735R(display_bus, width=160, height=128, rotation=90, bgr=True)
Expand Down
5 changes: 3 additions & 2 deletions examples/st7735r_minitft_featherwing_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_seesaw.seesaw import Seesaw
from adafruit_st7735r import ST7735R
Expand All @@ -26,7 +27,7 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)

ss.digital_write(reset_pin, True)
display = ST7735R(
Expand All @@ -35,7 +36,7 @@

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(160, 80, 1)
color_palette = displayio.Palette(1)
Expand Down
7 changes: 3 additions & 4 deletions examples/st7735r_minitft_revb_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_st7735r import ST7735R

Expand All @@ -19,9 +20,7 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)

display = ST7735R(
display_bus,
Expand All @@ -35,7 +34,7 @@

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(160, 80, 1)
color_palette = displayio.Palette(1)
Expand Down
7 changes: 3 additions & 4 deletions examples/st7735r_minitft_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_st7735r import ST7735R

Expand All @@ -19,17 +20,15 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)

display = ST7735R(
display_bus, width=160, height=80, colstart=24, rotation=270, bgr=True
)

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(160, 80, 1)
color_palette = displayio.Palette(1)
Expand Down
7 changes: 3 additions & 4 deletions examples/st7735r_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import board
import terminalio
import displayio
import fourwire
from adafruit_display_text import label
from adafruit_st7735r import ST7735R

Expand All @@ -19,15 +20,13 @@
tft_cs = board.D5
tft_dc = board.D6

display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
)
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)

display = ST7735R(display_bus, width=128, height=128, colstart=2, rowstart=1)

# Make the display context
splash = displayio.Group()
display.show(splash)
display.root_group = splash

color_bitmap = displayio.Bitmap(128, 128, 1)
color_palette = displayio.Palette(1)
Expand Down

0 comments on commit 8c34ad9

Please sign in to comment.