Phil Howard @gadgetoid has updated / fixed the generic st7789 driver.
I can now run two Display Pack V2’s side by side in portrait mode without issue. And have access to the full 320 height and 240 width. woot =)
I don’t have the buttons or LED’s wired up on this setup just yet.
The Display Packs are each mounted to Perma Proto half size, and the Pico to another Perma Proto half size. I just soldered male header on the Perma Proto’s and then soldered wires from board to board for SPI and power.
A big big thankyou Phil. A big thumbs up.
I’ll be starting a new thread as my build is now Pico based instaed of Raspberry Pi based.
My test file is as follows.
import time
import st7789
frame_buffer = bytearray(240 * 320 * 2) # 2-bytes per pixel (RGB565)
display1 = st7789.ST7789(width=240, height=320, buffer=frame_buffer, slot=0)
display2 = st7789.ST7789(width=240, height=320, buffer=frame_buffer, slot=1)
display1.set_backlight(1.0)
display2.set_backlight(1.0)
print(display1)
print(display2)
while True:
display1.set_pen(0, 0, 255)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(0, 255, 0)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(0, 255, 0)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(0, 255, 255)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(0, 255, 255)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(255, 0, 0)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(255, 0, 0)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front cs=(17)", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(255, 0, 255)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back cs=(22)", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(255, 0, 255)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front cs=(17) bl=(20)", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(255, 255, 0)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back cs=(22) bl=(21)", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(255, 255, 0)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front cs=(17) bl=(20) st7789", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(0, 0, 255)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back cs=(22) bl=(21) st7789", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(255, 255, 0)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front cs=(17) bl=(20) st7789 240 x 320", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(0, 0, 255)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back cs=(22) bl=(21) st7789 240 x 320", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
display1.set_pen(255, 255, 0)
display1.clear()
display1.update()
display1.set_pen(0, 0, 0) # Set pen to black
display1.text("display 1 slot 0 BG_front cs=(17) bl=(20) st7789 240 x 320 portrait", 10, 10, 240, 5)
display1.update()
display1.clear()
display2.set_pen(0, 0, 255)
display2.clear()
display2.update()
display2.set_pen(0, 0, 0) # Set pen to black
display2.text("display 2 slot 1 BG_back cs=(22) bl=(21) st7789 240 x 320 portrait", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)