Presto: Screen rotation

Dear all,

Is there a way to rotate the screen like this :
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_P4, rotate=90)

My issue is that I have initialized my presto this way :

presto = Presto(full_res=True)
presto.set_backlight(0.1)
display = presto.display
DISPLAY_PRESTO_WIDTH, DISPLAY_PRESTO_HEIGHT = display.get_bounds()
touch = presto.touch

And i have no clue how to set the rotation angle….

thanks!

display = presto.display, rotate=90 maybe?

Have you tried using the PicoGraphics on the Presto i.e.

display = PicoGraphics(display=picographics.DISPLAY_PRESTO_FULL_RES, rotate=90)

I’ve not tried it but I presume it would work as it has the display as per above in the PicoGraphic lib.

I expect you have a good reason for rotating a square display (480x480), but I suppose the poor old Presto may be on its side in a dead parrot kind of way :-)

In fact, i want to try to use it like this /| instead of /_ so a 180 rotation and not a 90 like in my example (hope it is clear :d). I think it could be interesting on my desk!

Currently trying to configure it “manually”, but not impact for now…

import _presto
from picographics import PicoGraphics, DISPLAY_PRESTO, DISPLAY_PRESTO_FULL_RES

presto = _presto.Presto(full_res=False)
buffer = memoryview(presto)
display = PicoGraphics(DISPLAY_PRESTO, buffer=buffer, rotate=180)
BLACK = display.create_pen(0, 0, 0)
WHITE = display.create_pen(255, 255, 255)
width, height = display.get_bounds()
print(width,height)
display.set_pen(BLACK)
display.clear()
display.set_pen(WHITE)
display.text(“Hello World !”,100,100,scale=2)display.update()

I should find a solution with this example: presto/examples/splash.py at 71b44cea305017c7b2e8e0576416832484dbc65f · pimoroni/presto · GitHub

vector.set_transform(t)
t.rotate(180, (CX, CY))

Maybe a bit overkill but you can really do crazy things from it :-D

Thanks all for your time

2 Likes

…good idea, indeed!

Cheers

1 Like