Skip to content

Commit d463938

Browse files
authored
Merge pull request #20 from FoamyGuy/odb_api_update
use new OnDiskBitmap API
2 parents 37283fc + cc3fd61 commit d463938

File tree

3 files changed

+17
-35
lines changed

3 files changed

+17
-35
lines changed

README.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,8 @@ Usage Example
8686
8787
g = displayio.Group()
8888
89-
f = open("/display-ruler.bmp", "rb")
90-
91-
pic = displayio.OnDiskBitmap(f)
92-
# CircuitPython 6 & 7 compatible
93-
t = displayio.TileGrid(
94-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
95-
)
96-
# CircuitPython 7 compatible only
97-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
89+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
90+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
9891
g.append(t)
9992
10093
display.root_group = g
@@ -105,6 +98,7 @@ Usage Example
10598
10699
time.sleep(120)
107100
101+
108102
Documentation
109103
=============
110104

examples/ssd1675_2.13_monochrome.py

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

3535
g = displayio.Group()
3636

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

47-
display.root_group = g
41+
display.root_group = g
4842

49-
display.refresh()
43+
display.refresh()
5044

51-
print("refreshed")
45+
print("refreshed")
5246

53-
time.sleep(120)
47+
time.sleep(120)

examples/ssd1675_simpletest.py

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

2929
g = displayio.Group()
3030

31-
with open("/display-ruler.bmp", "rb") as f:
32-
pic = displayio.OnDiskBitmap(f)
33-
# CircuitPython 6 & 7 compatible
34-
t = displayio.TileGrid(
35-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
36-
)
37-
# CircuitPython 7 compatible only
38-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
39-
g.append(t)
31+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
32+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
33+
g.append(t)
4034

41-
display.root_group = g
35+
display.root_group = g
4236

43-
display.refresh()
37+
display.refresh()
4438

45-
print("refreshed")
39+
print("refreshed")
4640

47-
time.sleep(120)
41+
time.sleep(120)

0 commit comments

Comments
 (0)