I'm pretty sure I have the wiring correct as my logic analyser is showing data on the MOSI lines. I get what looks like good data when DC is low and what appears to be errors when DC is high.
I am confident that the display is working as it works fins on a Raspberry Pi Zero but I'm having issues with the Pico.
I would appreciate any guidance or pointer to working examples.
Thanks in advance,
Mark
Code is :
Code: Select all
import busio
import board
import digitalio
from adafruit_rgb_display import color565
import adafruit_rgb_display.hx8357 as hx8357
backlight = digitalio.DigitalInOut(board.GP13)
cs_pin = digitalio.DigitalInOut(board.GP17)
dc_pin = digitalio.DigitalInOut(board.GP12)
reset_pin = digitalio.DigitalInOut(board.GP11)
backlight.switch_to_output()
backlight.value = True
spi = busio.SPI(clock = board.GP18, MOSI = board.GP19, MISO = board.GP16)
display = hx8357.HX8357(spi, rotation=180, width=480, height=320, cs=cs_pin, dc=dc_pin)
display.fill(color565(0, 0, 0))
x_scale = 4096 // 480
y_scale = 4096 // 320
display.fill_rectangle(40, 70, 100, 80, color565(255, 0, 0))
display.fill_rectangle(300, 200, 80, 120, color565(0, 255, 0))
#
# The line below stops the rectangles drawn being slowly overwritten.
#
display.fill_rectangle(0,0,1,1,color565(0,0,0))
while True:
pass