Skip to content

Commit 5f6ba46

Browse files
committed
Add example and lint
1 parent c51983c commit 5f6ba46

File tree

5 files changed

+85
-11
lines changed

5 files changed

+85
-11
lines changed

README.rst

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ Installing from PyPI
3131
.. note:: This library is not available on PyPI yet. Install documentation is included
3232
as a standard element. Stay tuned for PyPI availability!
3333

34-
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
35-
If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
36-
3734
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
3835
PyPI <https://pypi.org/project/adafruit-circuitpython-il91874/>`_. To install for current user:
3936

@@ -59,7 +56,47 @@ To install in a virtual environment in your current project:
5956
Usage Example
6057
=============
6158

62-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
59+
.. code-block:: python
60+
61+
"""Simple test script for 2.7" 264x176 Tri-Color display shield
62+
63+
Supported products:
64+
* Adafruit 2.7" Tri-Color ePaper Display Shield
65+
* https://www.adafruit.com/product/4229
66+
"""
67+
68+
import time
69+
import board
70+
import busio
71+
import displayio
72+
import adafruit_il91874
73+
74+
displayio.release_displays()
75+
76+
spi = board.SPI()
77+
epd_cs = board.D10
78+
epd_dc = board.D9
79+
80+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
81+
time.sleep(1)
82+
83+
display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000, rotation=90)
84+
85+
g = displayio.Group()
86+
87+
f = open("/display-ruler.bmp", "rb")
88+
89+
pic = displayio.OnDiskBitmap(f)
90+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
91+
g.append(t)
92+
93+
display.show(g)
94+
95+
display.refresh()
96+
97+
print("refreshed")
98+
99+
time.sleep(120)
63100
64101
Contributing
65102
============

adafruit_il91874.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
3434
**Hardware:**
3535
36-
.. todo:: Add links to any specific hardware product page(s), or category page(s). Use unordered list & hyperlink rST
37-
inline format: "* `Link Text <url>`_"
36+
* `Adafruit 2.7" Tri-Color ePaper Display Shield <https://www.adafruit.com/product/4229>`_
3837
3938
**Software and Dependencies:**
4039

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Uncomment the below if you use native CircuitPython modules such as
2121
# digitalio, micropython and busio. List the modules you use. Without it, the
2222
# autodoc module docs will fail to generate with a warning.
23-
# autodoc_mock_imports = ["digitalio", "busio"]
23+
autodoc_mock_imports = ["displayio"]
2424

2525

2626
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

docs/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
26+
Adafruit eInk Display Breakouts <https://learn.adafruit.com/adafruit-eink-display-breakouts>
27+
2828

2929
.. toctree::
3030
:caption: Related Products
3131

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
32+
Adafruit 2.7" Tri-Color ePaper Display Shield <https://www.adafruit.com/product/4229>
3433

3534
.. toctree::
3635
:caption: Other Links

examples/il91874_simpletest.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Simple test script for 2.7" 264x176 Tri-Color display shield
2+
3+
Supported products:
4+
* Adafruit 2.7" Tri-Color ePaper Display Shield
5+
* https://www.adafruit.com/product/4229
6+
"""
7+
8+
import time
9+
import board
10+
import busio
11+
import displayio
12+
import adafruit_il91874
13+
14+
displayio.release_displays()
15+
16+
spi = board.SPI()
17+
epd_cs = board.D10
18+
epd_dc = board.D9
19+
20+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
21+
time.sleep(1)
22+
23+
display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000, rotation=90)
24+
25+
g = displayio.Group()
26+
27+
f = open("/display-ruler.bmp", "rb")
28+
29+
pic = displayio.OnDiskBitmap(f)
30+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
31+
g.append(t)
32+
33+
display.show(g)
34+
35+
display.refresh()
36+
37+
print("refreshed")
38+
39+
time.sleep(120)

0 commit comments

Comments
 (0)