Skip to content

Commit 130e7f1

Browse files
committed
Create ssd1680_2.9_tricolor_breakout.py
1 parent b7d5117 commit 130e7f1

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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.9" Tri-Color eInk Display Breakout
8+
Supported products:
9+
* Adafruit 2.9" Tri-Color eInk Display Breakout
10+
* https://www.adafruit.com/product/1028
11+
12+
"""
13+
14+
import time
15+
16+
import board
17+
import displayio
18+
from fourwire import FourWire
19+
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+
epd_reset = board.D5
29+
epd_busy = board.D6
30+
31+
display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
32+
time.sleep(1)
33+
34+
display = adafruit_ssd1680.SSD1680(
35+
display_bus,
36+
width=296,
37+
height=128,
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(pic, pixel_shader=pic.pixel_shader)
48+
49+
g.append(t)
50+
51+
display.root_group = g
52+
53+
display.refresh()
54+
55+
print("refreshed")
56+
57+
time.sleep(120)

0 commit comments

Comments
 (0)