I have the following
Pi Pico
Pico Breakout Garden Base:
1.3" SPI Color Square LCD (240x240) Breakout: Rear SPI slot
1.54" SPI Color Square LCD (240x240) Breakout: Front SPI slot
Each display is using a different chip select and backlight pin but they are mirroring each other. I “think” the issue is the display buffer line.
display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
If I do this
display_buffer1 = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
display_buffer2 = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
I get MemoryError: memory allocation failed, allocating 115200 bytes for the second line.
import time
import machine
import gc
from breakout_colourlcd240x240 import BreakoutColourLCD240x240
width = BreakoutColourLCD240x240.WIDTH
height = BreakoutColourLCD240x240.HEIGHT
display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
display2 = BreakoutColourLCD240x240(display_buffer, cs=(22), bl=(21))
display2.set_backlight(0.8)
display1 = BreakoutColourLCD240x240(display_buffer, cs=(17), bl=(20))
display1.set_backlight(0.8)
while True:
display1.set_pen(255, 255, 255)
display1.text(rtc.string_date(), 40, 145, 240, 3)
display1.text(rtc.string_time(), 60, 165, 240, 3)
display1.update()
display2.update()
time.sleep(1)
display1.set_pen(0, 0, 0)
display1.clear()
display2.set_pen(0, 0, 0)
display2.clear()