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

bitmap_label flicker #178

Open
rdagger opened this issue Nov 15, 2022 · 2 comments
Open

bitmap_label flicker #178

rdagger opened this issue Nov 15, 2022 · 2 comments

Comments

@rdagger
Copy link

rdagger commented Nov 15, 2022

The bitmap_label has varying degrees of flicker when used to display frequently changing data. It is very noticeable and occurs regardless of the baud rate.

I switched from a regular label to save memory but immediately noticed the difference. The regular label has no perceivable flicker during updates.

from adafruit_display_text import bitmap_label, label
from adafruit_ssd1322 import SSD1322
from board import D9, D17, D18, SPI
import displayio
import gc
import terminalio
from time import sleep

displayio.release_displays()
display_bus = displayio.FourWire(SPI(), command=D9, chip_select=D18, reset=D17,
                                 baudrate=20000000)
display = SSD1322(display_bus, width=256, height=64, colstart=112)

label = label.Label(terminalio.FONT,
                    color=0xFFFFFF,
                    scale=2,
                    x=0,
                    y=20)

bmp_label = bitmap_label.Label(terminalio.FONT,
                               color=0xFFFFFF,
                               save_text=False,
                               scale=2,
                               anchor_point=(0, 0),
                               anchored_position=(0, 40))

group = displayio.Group()
group.append(label)
group.append(bmp_label)
display.show(group)

while True:
    label.text = f'L: {gc.mem_free()} bytes'
    bmp_label.text = f'B: {gc.mem_free()} bytes'
    sleep(2)
@FoamyGuy
Copy link
Contributor

FoamyGuy commented Jul 8, 2023

It might be worth trying out with display.auto_refresh = False and calling refresh() manually after you've changed the text.

I'm not certain, but my best guess on the flicker would be a refresh happening part way through it updating it's bitmap.

@snkYmkrct
Copy link
Contributor

There is indeed a visible flicker when updating a bitmap_label, especially for longer text.

I can confirm that turning off display.auto_refresh, and manually calling display.refresh() works to remove the flicker completely.

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

3 participants