Skip to content

Commit 99adf0f

Browse files
authored
Merge pull request #1 from tannewt/master
Add example and lint
2 parents 8ebfb0c + 6a3ac5b commit 99adf0f

File tree

5 files changed

+92
-13
lines changed

5 files changed

+92
-13
lines changed

README.rst

Lines changed: 44 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-ssd1608/>`_. To install for current user:
3936

@@ -59,7 +56,50 @@ 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 1.54" 200x200 monochrome display.
62+
63+
Supported products:
64+
* Adafruit 1.54" Monochrome ePaper Display Breakout
65+
* https://www.adafruit.com/product/4196
66+
"""
67+
68+
import time
69+
import board
70+
import displayio
71+
import adafruit_ssd1608
72+
73+
displayio.release_displays()
74+
75+
# This pinout works on a Feather M4 and may need to be altered for other boards.
76+
spi = board.SPI() # Uses SCK and MOSI
77+
epd_cs = board.D9
78+
epd_dc = board.D10
79+
epd_reset = board.D5
80+
epd_busy = board.D6
81+
82+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset,
83+
baudrate=1000000)
84+
time.sleep(1)
85+
86+
display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy)
87+
88+
g = displayio.Group()
89+
90+
f = open("/display-ruler.bmp", "rb")
91+
92+
pic = displayio.OnDiskBitmap(f)
93+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
94+
g.append(t)
95+
96+
display.show(g)
97+
98+
display.refresh()
99+
100+
print("refreshed")
101+
102+
time.sleep(120)
63103
64104
Contributing
65105
============

adafruit_ssd1608.py

Lines changed: 3 additions & 4 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 1.54" Monochrome ePaper Display Breakout <https://www.adafruit.com/product/4196>`_
3837
3938
**Software and Dependencies:**
4039
@@ -55,7 +54,8 @@
5554
b"\x3b\x01\x0b" # Set gate line width
5655
b"\x11\x01\x03" # Data entry sequence
5756
b"\x2c\x01\x70" # Vcom Voltage
58-
b"\x32\x1e\x02\x02\x01\x11\x12\x12\x22\x22\x66\x69\x69\x59\x58\x99\x99\x88\x00\x00\x00\x00\xf8\xb4\x13\x51\x35\x51\x51\x19\x01\x00" # LUT
57+
b"\x32\x1e\x02\x02\x01\x11\x12\x12\x22\x22\x66\x69\x69\x59\x58\x99\x99\x88\x00\x00\x00\x00\xf8"
58+
b"\xb4\x13\x51\x35\x51\x51\x19\x01\x00" # LUT
5959
b"\x22\x01\xc7" # Set DISP ctrl2
6060
)
6161

@@ -67,7 +67,6 @@
6767
class SSD1608(displayio.EPaperDisplay):
6868
"""SSD1608 driver"""
6969
def __init__(self, bus, **kwargs):
70-
color_command = None
7170
start_sequence = bytearray(_START_SEQUENCE)
7271
width = kwargs["width"]
7372
start_sequence[4] = width - 1

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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ 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>
2827

2928
.. toctree::
3029
:caption: Related Products
3130

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.
31+
Adafruit 1.54" Monochrome ePaper Display Breakout <https://www.adafruit.com/product/4196>
3432

3533
.. toctree::
3634
:caption: Other Links

examples/ssd1608_simpletest.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""Simple test script for 1.54" 200x200 monochrome display.
2+
3+
Supported products:
4+
* Adafruit 1.54" Monochrome ePaper Display Breakout
5+
* https://www.adafruit.com/product/4196
6+
"""
7+
8+
import time
9+
import board
10+
import displayio
11+
import adafruit_ssd1608
12+
13+
displayio.release_displays()
14+
15+
# This pinout works on a Feather M4 and may need to be altered for other boards.
16+
spi = board.SPI() # Uses SCK and MOSI
17+
epd_cs = board.D9
18+
epd_dc = board.D10
19+
epd_reset = board.D5
20+
epd_busy = board.D6
21+
22+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset,
23+
baudrate=1000000)
24+
time.sleep(1)
25+
26+
display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy)
27+
28+
g = displayio.Group()
29+
30+
f = open("/display-ruler.bmp", "rb")
31+
32+
pic = displayio.OnDiskBitmap(f)
33+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
34+
g.append(t)
35+
36+
display.show(g)
37+
38+
display.refresh()
39+
40+
print("refreshed")
41+
42+
time.sleep(120)

0 commit comments

Comments
 (0)