Display 2 python documentation

I have a RP pico with display 2. Im running micropython and can get it to write basic text to the top line, but im looking for some more/better documentation - espc on
display.text() and what all the parameters are.
.text(“string to write”, point_X??, point_Y???, ???, scale)

im not 100% on what params 2,3, and 4 are.

How can i change the font? is that possible?

and greater than just this, a pointer to where some documentation is for all the display method calls are etc?

I think this will help.
pimoroni-pico/README.md at main · pimoroni/pimoroni-pico (github.com)

perfect! great thanks for that.

If i want to run the whole display in portrait orientation, i assume i just rotate all my text 90 deg then? or is there some other way of doing that?

You change the rotate=0 to rotate=90 or rotate=270
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, rotate=0)

It seems

import picodisplay2 as display 


width = display.get_width()
height = display.get_height()

display_buffer = bytearray(width * height * 2)  # 2-bytes per pixel (RGB565)
display.init(display_buffer)

is a somewhat different to:

from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2`
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2)

to get where i current am, i have simply followed some examples for picodisplay 2 which work which use picodisplay2. But it seems picodisplay2 doesnt have set_font() or some other functions.

I guess, it seems the posted link above for documentation is for PicoGraphics module, and not picodisplay2

Also i cant even get a simple hello world working with the PicoGraphics module.

from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2)

display.set_backlight(1.0)
display.set_pen(0, 0, 0)
display.clear()       
display.update()   

display.set_pen(255, 255, 255)
display.text("Hello World", 10, 10, 10, 2)
display.update()

when i run the above, i get:

>>> Running d:\repos\Personal\pyplay\main.py
 
♦Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'picographics'

So i think i may have the wrong uf2?? im using pimoroni-pico-v1.18.7-micropython.uf2
i know its a bit old, but i cannot get later versions working for some reason.

picographics is the current way of doing things - I think picodisplay and picodisplay2 have been removed in recent versions.

You’ll need to download a recent pimoroni-pico uf2 to have access to it though! Releases · pimoroni/pimoroni-pico · GitHub

I just tried the latest UF2 and those examples with the picographics, and they work! great. Thanks for all your help dealing with me ;)

1 Like