Simple test

Ensure your device works with this simple test.

examples/ssd1680_simpletest.py
 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.
 7Supported 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 Breakout
13    * https://www.adafruit.com/product/4197
14  * Adafruit 2.13" Mono eInk Display FeatherWing
15    * https://www.adafruit.com/product/4195
16
17"""
18
19import time
20
21import board
22import displayio
23from fourwire import FourWire
24
25import adafruit_ssd1680
26
27displayio.release_displays()
28
29# This pinout works on a Metro M4 and may need to be altered for other boards.
30spi = board.SPI()  # Uses SCK and MOSI
31epd_cs = board.D9
32epd_dc = board.D10
33epd_reset = board.D8  # Set to None for FeatherWing
34epd_busy = board.D7  # Set to None for FeatherWing
35
36display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000)
37time.sleep(1)
38
39# For issues with display not updating top/bottom rows correctly set colstart to 8, 0, or -8
40display = adafruit_ssd1680.SSD1680(
41    display_bus,
42    width=250,
43    height=122,
44    busy_pin=epd_busy,
45    highlight_color=0xFF0000,
46    rotation=270,
47    colstart=-8,  # Comment out for older displays
48)
49
50
51g = displayio.Group()
52
53# Note: Check the name of the file. Sometimes the dash is changed to an underscore
54
55pic = displayio.OnDiskBitmap("/display-ruler-640x360.bmp")
56t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
57g.append(t)
58
59display.root_group = g
60
61display.refresh()
62
63print("refreshed")
64
65time.sleep(display.time_to_refresh + 5)
66# Always refresh a little longer. It's not a problem to refresh
67# a few seconds more, but it's terrible to refresh too early
68# (the display will throw an exception when if the refresh
69# is too soon)
70print("waited correct time")
71
72
73# Keep the display the same
74while True:
75    time.sleep(10)

2.13 ePaper Display FeatherWing Simple test

Ensure your 2.13 ePaper Display FeatherWing works with this simple test.

examples/ssd1680_2.13_featherwing.py
 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
 8Supported 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
17import time
18
19import board
20import displayio
21from fourwire import FourWire
22
23import adafruit_ssd1680
24
25displayio.release_displays()
26
27# This pinout works on a Metro M4 and may need to be altered for other boards.
28spi = board.SPI()  # Uses SCK and MOSI
29epd_cs = board.D9
30epd_dc = board.D10
31
32display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
33time.sleep(1)
34
35display = adafruit_ssd1680.SSD1680(
36    display_bus,
37    width=250,
38    height=122,
39    highlight_color=0xFF0000,
40    rotation=270,
41)
42
43g = displayio.Group()
44
45
46pic = displayio.OnDiskBitmap("/display-ruler-640x360.bmp")
47
48t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
49
50g.append(t)
51
52display.root_group = g
53
54display.refresh()
55
56print("refreshed")
57
58time.sleep(display.time_to_refresh + 5)
59# Always refresh a little longer. It's not a problem to refresh
60# a few seconds more, but it's terrible to refresh too early
61# (the display will throw an exception when if the refresh
62# is too soon)
63print("waited correct time")
64
65
66# Keep the display the same
67while True:
68    time.sleep(10)

2.13 TriColor Breakout Simple test

Ensure your 2.13 ePaper TriColor breakout Display works with this simple test.

examples/ssd1680_2.13_tricolor_breakout.py
 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
 8Supported products:
 9  * Adafruit 2.13" Tri-Color eInk Display Breakout
10    * https://www.adafruit.com/product/4947
11
12"""
13
14import time
15
16import board
17import displayio
18from fourwire import FourWire
19
20import adafruit_ssd1680
21
22displayio.release_displays()
23
24# This pinout works on a Metro M4 and may need to be altered for other boards.
25spi = board.SPI()  # Uses SCK and MOSI
26epd_cs = board.D9
27epd_dc = board.D10
28epd_reset = board.D5
29epd_busy = board.D6
30
31display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000)
32time.sleep(1)
33
34display = adafruit_ssd1680.SSD1680(
35    display_bus,
36    width=250,
37    height=122,
38    highlight_color=0xFF0000,
39    rotation=270,
40)
41
42g = displayio.Group()
43
44
45pic = displayio.OnDiskBitmap("/display-ruler-640x360.bmp")
46
47t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
48
49g.append(t)
50
51display.root_group = g
52
53display.refresh()
54
55print("refreshed")
56
57time.sleep(120)