Skip to content

Commit 67ccde8

Browse files
authored
Merge pull request #12 from jposada202020/adding_breakout_example
adding example for the 2.13 Tricolor Breakout
2 parents 91b6867 + 4c228d6 commit 67ccde8

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

docs/examples.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,12 @@ Ensure your 2.13 ePaper Display FeatherWing works with this simple test.
1515
.. literalinclude:: ../examples/ssd1680_2.13_featherwing.py
1616
:caption: examples/ssd1680_2.13_featherwing.py
1717
:linenos:
18+
19+
2.13 TriColor Breakout Simple test
20+
---------------------------------------
21+
22+
Ensure your 2.13 ePaper TriColor breakout Display works with this simple test.
23+
24+
.. literalinclude:: ../examples/ssd1680_2.13_tricolor_breakout.py
25+
:caption: examples/ssd1680_2.13_tricolor_breakout.py
26+
:linenos:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 Adafruit 2.13" Tri-Color eInk Display Breakout
8+
Supported products:
9+
* Adafruit 2.13" Tri-Color eInk Display Breakout
10+
* https://www.adafruit.com/product/4947
11+
12+
"""
13+
14+
import time
15+
import board
16+
import displayio
17+
import adafruit_ssd1680
18+
19+
displayio.release_displays()
20+
21+
# This pinout works on a Metro M4 and may need to be altered for other boards.
22+
spi = board.SPI() # Uses SCK and MOSI
23+
epd_cs = board.D9
24+
epd_dc = board.D10
25+
epd_reset = board.D5
26+
epd_busy = board.D6
27+
28+
display_bus = displayio.FourWire(
29+
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
30+
)
31+
time.sleep(1)
32+
33+
display = adafruit_ssd1680.SSD1680(
34+
display_bus,
35+
colstart=8,
36+
width=250,
37+
height=122,
38+
highlight_color=0xFF0000,
39+
rotation=270,
40+
)
41+
42+
g = displayio.Group()
43+
44+
with open("/display-ruler.bmp", "rb") as f:
45+
pic = displayio.OnDiskBitmap(f)
46+
47+
t = displayio.TileGrid(
48+
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
49+
)
50+
51+
g.append(t)
52+
53+
display.show(g)
54+
55+
display.refresh()
56+
57+
print("refreshed")
58+
59+
time.sleep(120)

0 commit comments

Comments
 (0)