Skip to content

Documentation example for displayio does not work. #2622

@geekguy-wy

Description

@geekguy-wy

I worked with displayio on my PyGamer a bit and discovered that the example on this page does not work.

I worked on this example with my PyGamer and have a new version of the script that does work:

import board
import displayio
import time
import pulseio

board.DISPLAY.auto_brightness = False
board.DISPLAY.brightness = 0
splash = displayio.Group()
board.DISPLAY.show(splash)

with open("/sample.bmp", "rb") as f:
    odb = displayio.OnDiskBitmap(f)
    face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter(), width=160, height=128, x=0, y=0)
    splash.append(face)
    board.DISPLAY.show(splash)

    # Fade up the backlight
    for i in range(100):
        board.DISPLAY.brightness = 0.01 * i
        time.sleep(0.05)

    # Wait forever
    while True:
        pass

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions