Actually the rotation isn’t a big deal, might actually be better in portrait mode. More testing has shown its only using 240x240, the bottom 1/4 of the screen is unusable.
Phil Howard has done up a unifying driver that works on the Display Pack, supports landscape or portrait mode, and supports alternate pin selection. In theory I can setup two displays each on a different chip select and different backlight pin. I can’t get it to run two displays at once though.
Pico Display Pack V2 x 2? · Issue #299 · pimoroni/pimoroni-pico (github.com)
Unified display drivers · Issue #309 · pimoroni/pimoroni-pico (github.com)
This works using the current official driver.
import time
from breakout_colourlcd240x240 import BreakoutColourLCD240x240
display_buffer = bytearray(240 * 240 * 2) # 2-bytes per pixel (RGB565)
display1 = BreakoutColourLCD240x240(display_buffer, cs=(17), bl=(20))
display2 = BreakoutColourLCD240x240(display_buffer, cs=(22), bl=(21))
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 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 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 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 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 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 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 front cs=(17) bl=(20) 240x240", 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 back cs=(22) bl=(21) 240x240", 10, 10, 240, 5)
display2.update()
display2.clear()
time.sleep(2)
If I substitute in the following:
import st7789
frame_buffer = bytearray(240 * 240 * 2) # 2-bytes per pixel (RGB565)
display1 = st7789.ST7789(width=240, height=240, *frame_buffer, slot=0) #front
display2 = st7789.ST7789(width=240, height=240, *frame_buffer, slot=1) #back
I get a memory allocation error
import st7789
and
display1 = st7789.ST7789(width=240, height=240, slot=0) #front
or
display2 = st7789.ST7789(width=240, height=240, slot=1) #back
will run one or the other displays.
all three lines get me the same memory allocation error. 264 kb isn’t enough room for two display buffers.