Skip to content

Commit ffa1958

Browse files
committed
Initial linting
1 parent 8ebfb0c commit ffa1958

File tree

5 files changed

+98
-12
lines changed

5 files changed

+98
-12
lines changed

README.rst

Lines changed: 47 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,53 @@ 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 busio
71+
import displayio
72+
import adafruit_ssd1608
73+
74+
displayio.release_displays()
75+
76+
# This pinout works on a Metro and may need to be altered for other boards.
77+
78+
# For breadboarding
79+
spi = busio.SPI(board.SCL, board.SDA)
80+
epd_cs = board.D9
81+
epd_dc = board.D8
82+
epd_reset = board.D7
83+
epd_busy = board.D6
84+
85+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset,
86+
baudrate=1000000)
87+
time.sleep(1)
88+
89+
display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy)
90+
91+
g = displayio.Group()
92+
93+
f = open("/display-ruler.bmp", "rb")
94+
95+
pic = displayio.OnDiskBitmap(f)
96+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
97+
g.append(t)
98+
99+
display.show(g)
100+
101+
display.refresh()
102+
103+
print("refreshed")
104+
105+
time.sleep(120)
63106
64107
Contributing
65108
============

adafruit_ssd1608.py

Lines changed: 3 additions & 3 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

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: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 busio
11+
import displayio
12+
import adafruit_ssd1608
13+
14+
displayio.release_displays()
15+
16+
# This pinout works on a Metro and may need to be altered for other boards.
17+
18+
# For breadboarding
19+
spi = busio.SPI(board.SCL, board.SDA)
20+
epd_cs = board.D9
21+
epd_dc = board.D8
22+
epd_reset = board.D7
23+
epd_busy = board.D6
24+
25+
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset,
26+
baudrate=1000000)
27+
time.sleep(1)
28+
29+
display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=epd_busy)
30+
31+
g = displayio.Group()
32+
33+
f = open("/display-ruler.bmp", "rb")
34+
35+
pic = displayio.OnDiskBitmap(f)
36+
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
37+
g.append(t)
38+
39+
display.show(g)
40+
41+
display.refresh()
42+
43+
print("refreshed")
44+
45+
time.sleep(120)

0 commit comments

Comments
 (0)