Attached is a photo of my wiring. There's nothing plugged into the Stemma connector. That big blue jumper connects BL on the display to A3 on the Feather.
Below is the code, more or less the demo code I found on Adafruit.
I have tried CircuitPython 8.2.0-beta.0 (for some cool new synthio stuff that I really want to use), 8.1.0, and 7.3.0.
Any suggestions appreciated.
Library versions used:
Code: Select all
adafruit_lis3dh==5.1.23
adafruit_ili9341==1.3.10
adafruit_ticks==1.0.11
adafruit_max9744==1.2.14
adafruit_displayio_sh1107==1.5.11
adafruit_pixelbuf==2.0.2
adafruit_vl53l0x==3.6.9
adafruit_vl53l4cd==1.1.5
neopixel==6.3.9
adafruit_bus_device==5.2.6
adafruit_display_text==2.28.3
adafruit_circuitplayground==5.3.2
adafruit_bitmap_font==2.0.1
adafruit_ht16k33==4.6.5
asyncio==0.5.22
adafruit_rgb_display==3.11.3
adafruit_seesaw==1.12.1
adafruit_register==1.9.16
adafruit_apds9960==3.1.8
The code:
Code: Select all
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This test will initialize the display using displayio and draw a solid green
background, a smaller purple rectangle, and some yellow text. All drawing is done
using native displayio modules.
Pinouts are now for the Adafruit Feather RP2040 "Featheremin" project.
"""
import board
import terminalio
import displayio
from adafruit_display_text import label
import adafruit_ili9341
import digitalio
print("ILI9341 demo.....")
# Release any resources currently in use for the displays
displayio.release_displays()
spi = board.SPI()
tft_cs = board.A2
tft_dc = board.A0
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.A1)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
# Make the display context
splash = displayio.Group()
display.show(splash)
# Draw a green background
color_bitmap = displayio.Bitmap(320, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00 # Bright Green
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
# Draw a smaller inner rectangle
inner_bitmap = displayio.Bitmap(280, 200, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0xAA0088 # Purple
inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20)
splash.append(inner_sprite)
# Draw a label
text_group = displayio.Group(scale=3, x=57, y=120)
text = "Hello World!"
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
text_group.append(text_area) # Subgroup for text scaling
splash.append(text_group)
# added backlight code
backlight = digitalio.DigitalInOut(board.A3)
backlight.switch_to_output()
backlight.value = True
print("Demo done?")
# if the code stops, the display gets erased. Why?
# so do this to wait forever:
while True:
pass