Here is an example on the Display 2
# Display User Symbols on the Display2 screen
# Tony Goodhew 16th March 2023
import time
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, get_buffer_size, PEN_RGB332
from pimoroni import RGBLED
# Reduced colours to save RAM
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB332, rotate=0)
display.set_backlight(0.8)
display.set_font("bitmap8") # Lower case included
led = RGBLED(6, 7, 8)
led.set_rgb(0,0,0) # Turn RGBLED OFF
powers =[]
z = 1
for i in range(32):
powers.append(z)
z = z * 2
# Define a 32x32 pixel symbol
test1 = [0b11111111111111111111111111111111,
0b11000000000000000000000000000001,
0b10100000000000000000000000000001,
0b10010000000000000000000000000001,
0b10001000000000000000000000000001,
0b10000100000000000000000000000001,
0b10000010000000000000000000000001,
0b10000001000000000000000000000001,
0b10000000100000000000000000000001,
0b10000000010000000000000000000001,
0b10000000001000000000000000000001,
0b10000000000100000000000000000001,
0b10000000000010000000000000000001,
0b10000000000001000000000000000001,
0b10000000000000100000000000000001,
0b10000000000000010000000000000001,
0b10000000000000001000000000000001,
0b10000000000000000100000000000001,
0b10000000000000000010000000000001,
0b10000000000000000001000000000001,
0b10000000000000000000100000000001,
0b10000000000000000000010000000001,
0b10000000000000000000001000000001,
0b10000000000000000000000100000001,
0b10000000000000000000000010000001,
0b10000000000000000000000001000001,
0b10000000000000000000000000100001,
0b10000000000000000000000000010001,
0b10000000000000000000000000001001,
0b10000000000000000000000000000101,
0b10000000000000000000000000000011,
0b11111111111111111111111111111111]
# Place a symbol on the screen
def symbol(t,xoff,yoff):
for yy in range(32):
line = t[yy]
for xx in range(32):
xxx = 31 - xx
if (line & powers[xxx]) == powers[xxx]:
display.set_pen(255)
else:
display.set_pen(0)
display.pixel(xx + xoff, yy +yoff)
symbol(test1,0,46)
symbol(test1,0,160)
symbol(test1,319-32,48)
symbol(test1,319-32,162)
display.update()