Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental screen updates with Luma and SH1106? #386

Open
zapta opened this issue Dec 30, 2023 · 1 comment
Open

Incremental screen updates with Luma and SH1106? #386

zapta opened this issue Dec 30, 2023 · 1 comment

Comments

@zapta
Copy link

zapta commented Dec 30, 2023

Firstly thanks for taking the time to file an issue. Chances are, you are not the first (and
wont be the last) to have this problem: By creating a public issue, others can browse and
solve their issues - possibly in a self-service style - just by reading the discourse on your
ticket, so try and be clear in the describing the problem you have.

Secondly, github issues are not just for raising problems - if you have a question, a
documentation fix, or suggested improvement, please get in touch.

Lastly, there are a number of related LUMA projects - please check to make sure to create
the issue in the right GitHub repository.

Type of Raspberry Pi

Not all Pi's are equal at the hardware level - what works on one, might not work on the next.
This library has been tested on every variant except the RPi3.

I am not using PI but this issue is not platform related.

Linux Kernel version

Paste in the output from running uname -a at the command line on your Pi.

I am not using Linux but this question is not platform related.

Expected behaviour

Add a few concise notes about what you are expecting to happen.
Even better, if you paste in a code sample that demonstrates what you want to achieve.

If only a small area of the screen got changed, write only that area rather than the entire screen. E.g. find a writeable bounding box of the modified pixels and update just that portion onthe screen.

Actual behaviour

Now add some details about what actually happened - if there is an unexpected crash, paste in the
traceback info.

I wrote a small program that updates a numeric field on a SH1106 OLED and it works well (thanks). I did observed though that even ifI change only a small area of the screen, the entire screen is written on each update.

My question is, does Luma support incremental updates? And if not, please add it to your feature request list.

My drawing code:

i = 0
while True:
    with canvas(oled) as draw:
        print(f"Drawing {i}", flush=True)
        # draw.rectangle(oled.bounding_box, outline="white", fill="black")
        # draw.text((19, 15), f"Hello  I2C Adapter", fill="white")
        draw.text((47, 42), f"{i:05d}", fill="white")
    i += 1
    time.sleep(1.0)

Full program at https://github.com/zapta/i2c_adapter/blob/main/examples/oled_demo.py

@zapta zapta changed the title Incremental screen updates on SH1106? Incremental screen updates with Luma and SH1106? Dec 30, 2023
@zapta
Copy link
Author

zapta commented Dec 30, 2023

... I found the discussion below but it deals with the rendering side rather than the screen update (i2c in that case). From my experience, the I2C communication is the bottleneck of the screen refresh process with SH1106 in I2C mode.

https://stackoverflow.com/questions/64189757/add-element-to-oled-display-via-pil-python-without-erasing-rest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant