Skip to content

Commit 788bad8

Browse files
authored
Merge pull request #20 from FoamyGuy/odb_api_update
use new OnDiskBitmap API
2 parents 8f155e7 + 2a09649 commit 788bad8

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

README.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,8 @@ Usage Example
8989
9090
g = displayio.Group()
9191
92-
f = open("/display-ruler.bmp", "rb")
93-
94-
pic = displayio.OnDiskBitmap(f)
95-
# CircuitPython 6 & 7 compatible
96-
t = displayio.TileGrid(
97-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
98-
)
99-
# CircuitPython 7 compatible only
100-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
92+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
93+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
10194
g.append(t)
10295
10396
display.root_group = g
@@ -108,6 +101,7 @@ Usage Example
108101
109102
time.sleep(120)
110103
104+
111105
Documentation
112106
=============
113107

examples/ssd1608_simpletest.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,14 @@
3636

3737
g = displayio.Group()
3838

39-
with open("/display-ruler.bmp", "rb") as f:
40-
pic = displayio.OnDiskBitmap(f)
41-
# CircuitPython 6 & 7 compatible
42-
t = displayio.TileGrid(
43-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
44-
)
45-
# CircuitPython 7 compatible only
46-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
47-
g.append(t)
39+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
40+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
41+
g.append(t)
4842

49-
display.root_group = g
43+
display.root_group = g
5044

51-
display.refresh()
45+
display.refresh()
5246

53-
print("refreshed")
47+
print("refreshed")
5448

55-
time.sleep(120)
49+
time.sleep(120)

0 commit comments

Comments
 (0)