Update to use fourwire and root_group for CP 9 compatibility
This commit is contained in:
parent
04a387e19c
commit
fea469d970
4 changed files with 12 additions and 10 deletions
|
|
@ -36,6 +36,7 @@ Usage Example
|
|||
|
||||
import board
|
||||
import displayio
|
||||
import fourwire
|
||||
import adafruit_ili9341
|
||||
|
||||
spi = board.SPI()
|
||||
|
|
@ -43,13 +44,13 @@ Usage Example
|
|||
tft_dc = board.D10
|
||||
|
||||
displayio.release_displays()
|
||||
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
|
||||
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
|
||||
|
||||
# Make the display context
|
||||
splash = displayio.Group()
|
||||
display.show(splash)
|
||||
display.root_group = splash
|
||||
|
||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||
color_palette = displayio.Palette(1)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ Pinouts are for the PiTFT and should be run in CPython.
|
|||
import board
|
||||
import terminalio
|
||||
import displayio
|
||||
import fourwire
|
||||
from adafruit_display_text import label
|
||||
import adafruit_ili9341
|
||||
|
||||
|
|
@ -21,12 +22,12 @@ spi = board.SPI()
|
|||
tft_cs = board.CE0
|
||||
tft_dc = board.D25
|
||||
|
||||
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
|
||||
|
||||
# Make the display context
|
||||
splash = displayio.Group()
|
||||
display.show(splash)
|
||||
display.root_group = splash
|
||||
|
||||
# Draw a green background
|
||||
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Pinouts are for the 2.8" TFT Shield
|
|||
import board
|
||||
import terminalio
|
||||
import displayio
|
||||
import fourwire
|
||||
from adafruit_display_text import label
|
||||
import adafruit_ili9341
|
||||
|
||||
|
|
@ -26,12 +27,12 @@ spi = board.SPI()
|
|||
tft_cs = board.D10
|
||||
tft_dc = board.D9
|
||||
|
||||
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
|
||||
|
||||
# Make the display context
|
||||
splash = displayio.Group()
|
||||
display.show(splash)
|
||||
display.root_group = splash
|
||||
|
||||
# Draw a green background
|
||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ Pinouts are for the 2.4" TFT FeatherWing or Breakout with a Feather M4 or M0.
|
|||
import board
|
||||
import terminalio
|
||||
import displayio
|
||||
import fourwire
|
||||
from adafruit_display_text import label
|
||||
import adafruit_ili9341
|
||||
|
||||
|
|
@ -21,14 +22,12 @@ spi = board.SPI()
|
|||
tft_cs = board.D9
|
||||
tft_dc = board.D10
|
||||
|
||||
display_bus = displayio.FourWire(
|
||||
spi, command=tft_dc, chip_select=tft_cs, reset=board.D6
|
||||
)
|
||||
display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
|
||||
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
|
||||
|
||||
# Make the display context
|
||||
splash = displayio.Group()
|
||||
display.show(splash)
|
||||
display.root_group = splash
|
||||
|
||||
# Draw a green background
|
||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue