Skip to content

Commit 5b9337f

Browse files
authored
Merge pull request #20 from makermelissa/bonnet-example
Add an example for the 2.13 inch eink bonnet
2 parents 966bf35 + 8e63ed5 commit 5b9337f

5 files changed

+71
-4
lines changed

examples/ssd1680_2.13_featherwing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
display = adafruit_ssd1680.SSD1680(
3535
display_bus,
36-
colstart=8,
3736
width=250,
3837
height=122,
3938
highlight_color=0xFF0000,
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
3+
#
4+
# SPDX-License-Identifier: Unlicense
5+
6+
"""Simple test script for 2.13" 250x122 tri-color display.
7+
Supported products:
8+
* Adafruit 2.13" Tri-Color eInk Display Breakout
9+
* https://www.adafruit.com/product/4947
10+
* Adafruit 2.13" Tri-Color eInk Display FeatherWing
11+
* https://www.adafruit.com/product/4814
12+
* Adafruit 2.13" Mono eInk Display FeatherWing
13+
* https://www.adafruit.com/product/4195
14+
15+
16+
"""
17+
18+
import time
19+
import board
20+
import displayio
21+
import adafruit_ssd1680
22+
23+
displayio.release_displays()
24+
25+
# This pinout works on a Metro M4 and may need to be altered for other boards.
26+
spi = board.SPI() # Uses SCK and MOSI
27+
epd_cs = board.CE0
28+
epd_dc = board.D22
29+
epd_reset = board.D27 # Set to None for FeatherWing
30+
epd_busy = board.D17 # Set to None for FeatherWing
31+
32+
display_bus = displayio.FourWire(
33+
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
34+
)
35+
time.sleep(1)
36+
37+
# For issues with display not updating top/bottom rows correctly set colstart to 8
38+
display = adafruit_ssd1680.SSD1680(
39+
display_bus,
40+
width=250,
41+
height=122,
42+
busy_pin=epd_busy,
43+
highlight_color=0xFF0000,
44+
rotation=90,
45+
)
46+
47+
48+
g = displayio.Group()
49+
50+
with open("display-ruler.bmp", "rb") as f:
51+
pic = displayio.OnDiskBitmap(f)
52+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
53+
g.append(t)
54+
55+
display.show(g)
56+
57+
display.refresh()
58+
59+
print("refreshed")
60+
61+
time.sleep(display.time_to_refresh + 5)
62+
# Always refresh a little longer. It's not a problem to refresh
63+
# a few seconds more, but it's terrible to refresh too early
64+
# (the display will throw an exception when if the refresh
65+
# is too soon)
66+
print("waited correct time")
67+
68+
69+
# Keep the display the same
70+
while True:
71+
time.sleep(10)

examples/ssd1680_2.13_tricolor_breakout.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
display = adafruit_ssd1680.SSD1680(
3434
display_bus,
35-
colstart=8,
3635
width=250,
3736
height=122,
3837
highlight_color=0xFF0000,

examples/ssd1680_four_corners.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
)
3333
display = adafruit_ssd1680.SSD1680(
3434
display_bus,
35-
colstart=8,
3635
width=250,
3736
height=122,
3837
busy_pin=epd_busy,

examples/ssd1680_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# For issues with display not updating top/bottom rows correctly set colstart to 8
3838
display = adafruit_ssd1680.SSD1680(
3939
display_bus,
40-
colstart=8,
4140
width=250,
4241
height=122,
4342
busy_pin=epd_busy,

0 commit comments

Comments
 (0)