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
18 changes: 11 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,20 @@ Usage Example

g = displayio.Group()

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

display.root_group = g
# Place the display group on the screen
display.root_group = g

display.refresh()
# Refresh the display to have it actually show the image
# NOTE: Do not refresh eInk displays sooner than 180 seconds
display.refresh()
print("refreshed")

time.sleep(180)

time.sleep(120)


Documentation
Expand Down
27 changes: 10 additions & 17 deletions examples/uc8151d_2.9_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,16 @@
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)
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

# Place the display group on the screen
display.root_group = g
# Place the display group on the screen
display.root_group = g

# Refresh the display to have it actually show the image
# NOTE: Do not refresh eInk displays sooner than 180 seconds
display.refresh()
print("refreshed")
# Refresh the display to have it actually show the image
# NOTE: Do not refresh eInk displays sooner than 180 seconds
display.refresh()
print("refreshed")

time.sleep(180)
time.sleep(180)
17 changes: 10 additions & 7 deletions examples/uc8151d_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@

g = displayio.Group()

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

display.root_group = g
# Place the display group on the screen
display.root_group = g

display.refresh()
# Refresh the display to have it actually show the image
# NOTE: Do not refresh eInk displays sooner than 180 seconds
display.refresh()
print("refreshed")

time.sleep(120)
time.sleep(180)