Waveshare e-paper display how to rotate?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: Waveshare e-paper display how to rotate?

Post by ernitron » Sat Dec 23, 2023 10:45 am

Sorry but, I really couldn't understand this thread.
Rotating a frame buffer is as simple as (or I am missing something?):

Code: Select all

import framebuf

def bufrotate(fb, w, h, defaultcolor=1):
    rotatebuf = bytearray(w * h // 8)
    rotatefb = framebuf.FrameBuffer(rotatebuf, h, w, framebuf.MONO_HLSB)
    for x in range(h):
        for y in range(w):
             rotatefb.pixel(x,y, fb.pixel(w-1-y,x))
    return rotatebuf
Long time no see... what happened to this glorious forum? Did we really need to migrate the whole community on github? Just saying...

Post Reply