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
10 changes: 6 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ This is easily achieved by downloading

Installing from PyPI
=====================
.. note:: This library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-il0373/>`_. To install for current user:

Expand Down Expand Up @@ -86,7 +83,12 @@ Usage Example
f = open("/display-ruler.bmp", "rb")

pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down
27 changes: 27 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,30 @@ Ensure your device works with this simple test.
.. literalinclude:: ../examples/il0373_simpletest.py
:caption: examples/il0373_simpletest.py
:linenos:

Device Specific Examples
------------------------

.. literalinclude:: ../examples/il0373_1.54_color.py
:caption: examples/il0373_1.54_color.py
:linenos:

.. literalinclude:: ../examples/il0373_2.9_color.py
:caption: examples/il0373_2.9_color.py
:linenos:

.. literalinclude:: ../examples/il0373_2.9_grayscale.py
:caption: examples/il0373_2.9_grayscale.py
:linenos:

.. literalinclude:: ../examples/il0373_2.13_color.py
:caption: examples/il0373_2.13_color.py
:linenos:

.. literalinclude:: ../examples/il0373_flexible_2.9_monochrome.py
:caption: examples/il0373_flexible_2.9_monochrome.py
:linenos:

.. literalinclude:: ../examples/il0373_flexible_2.13_monochrome.py
:caption: examples/il0373_2.13_monochrome.py
:linenos:
7 changes: 6 additions & 1 deletion examples/il0373_1.54_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_2.13_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@
with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
# Create a Tilegrid with the bitmap and put in the displayio group
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_2.9_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
# Create a Tilegrid with the bitmap and put in the displayio group
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_2.9_grayscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_flexible_2.13_monochrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_flexible_2.9_monochrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down
7 changes: 6 additions & 1 deletion examples/il0373_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
# 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)

display.show(g)
Expand Down