Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,23 @@ Usage Example

g = displayio.Group()

f = open("/display-ruler.bmp", "rb")

pic = displayio.OnDiskBitmap(f)
# CircuitPython 6 & 7 compatible
t = displayio.TileGrid(
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
)
# CircuitPython 7 compatible only
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
# Create a Tilegrid with the bitmap and put in the displayio group
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

# Place the display group on the screen (does not refresh)
display.root_group = g

# Show the image on the display
display.refresh()

print("refreshed")

time.sleep(120)
# Do Not refresh the screen more often than every 180 seconds
# for eInk displays! Rapid refreshes will damage the panel.
time.sleep(180)


Documentation
=============
Expand Down
39 changes: 17 additions & 22 deletions examples/il91874_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,20 @@
g = displayio.Group()

# Display a ruler graphic from the root directory of the CIRCUITPY drive
with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
# Create a Tilegrid with the bitmap and put in the displayio group
# CircuitPython 6 & 7 compatible
t = displayio.TileGrid(
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
)
# CircuitPython 7 compatible only
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

# Place the display group on the screen (does not refresh)
display.root_group = g

# Show the image on the display
display.refresh()

print("refreshed")

# Do Not refresh the screen more often than every 180 seconds
# for eInk displays! Rapid refreshes will damage the panel.
time.sleep(180)

pic = displayio.OnDiskBitmap("/display-ruler.bmp")
# Create a Tilegrid with the bitmap and put in the displayio group
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

# Place the display group on the screen (does not refresh)
display.root_group = g

# Show the image on the display
display.refresh()

print("refreshed")

# Do Not refresh the screen more often than every 180 seconds
# for eInk displays! Rapid refreshes will damage the panel.
time.sleep(180)