Skip to content

Commit c5400c0

Browse files
committed
adding_new_example
1 parent dfff3b6 commit c5400c0

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

docs/examples.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ Ensure your device works with this simple test.
66
.. literalinclude:: ../examples/ssd1680_simpletest.py
77
:caption: examples/ssd1680_simpletest.py
88
:linenos:
9+
10+
2.13 ePaper Display FeatherWing Simple test
11+
---------------------------------------------
12+
13+
Ensure your 2.13 ePaper Display FeatherWing works with this simple test.
14+
15+
.. literalinclude:: ../examples/ssd1680_2.13_featherwing.py
16+
:caption: examples/ssd1680_2.13_featherwing.py
17+
:linenos:

docs/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ Table of Contents
2424
.. toctree::
2525
:caption: Tutorials
2626

27+
Adafruit 2.13" eInk Display Breakouts and FeatherWings <https://learn.adafruit.com/adafruit-2-13-eink-display-breakouts-and-featherwings>
28+
2729
.. toctree::
2830
:caption: Related Products
2931

3032
Adafruit 2.13" 250x122 Tri-Color eInk / ePaper Display with SRAM - SSD1680 Driver <https://www.adafruit.com/product/4947>
3133
Adafruit 2.13" HD Tri-Color eInk / ePaper Display FeatherWing <https://www.adafruit.com/product/4814>
34+
Adafruit 2.13" Mono eInk Display FeatherWing <https://www.adafruit.com/product/4195>
3235

3336
.. toctree::
3437
:caption: Other Links

examples/ssd1680_2.13_featherwing.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya
3+
#
4+
# SPDX-License-Identifier: Unlicense
5+
6+
7+
"""Simple test script for 2.13" 250x122 eInk Display FeatherWing
8+
Supported products:
9+
* Adafruit 2.13" Tri-Color eInk Display FeatherWing
10+
* https://www.adafruit.com/product/4814
11+
* Adafruit 2.13" Mono eInk Display FeatherWing
12+
* https://www.adafruit.com/product/4195
13+
14+
15+
"""
16+
17+
import time
18+
import board
19+
import displayio
20+
import adafruit_ssd1680
21+
22+
displayio.release_displays()
23+
24+
# This pinout works on a Metro M4 and may need to be altered for other boards.
25+
spi = board.SPI() # Uses SCK and MOSI
26+
epd_cs = board.D9
27+
epd_dc = board.D10
28+
29+
display_bus = displayio.FourWire(
30+
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
31+
)
32+
time.sleep(1)
33+
34+
display = adafruit_ssd1680.SSD1680(
35+
display_bus,
36+
colstart=8,
37+
width=250,
38+
height=122,
39+
highlight_color=0xFF0000,
40+
rotation=270,
41+
)
42+
43+
g = displayio.Group()
44+
45+
with open("/display-ruler.bmp", "rb") as f:
46+
pic = displayio.OnDiskBitmap(f)
47+
48+
t = displayio.TileGrid(
49+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
50+
)
51+
52+
g.append(t)
53+
54+
display.show(g)
55+
56+
display.refresh()
57+
58+
print("refreshed")
59+
60+
time.sleep(120)

0 commit comments

Comments
 (0)