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