Simple test

Ensure your monochrome featherwing works with this simple test.

examples/ssd1675_simpletest.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4"""Simple test script for 2.13" 250x122 black and white featherwing.
 5
 6Supported products:
 7  * Adafruit 2.13" Black and White FeatherWing
 8    * https://www.adafruit.com/product/4195
 9  """
10
11import time
12import board
13import displayio
14import adafruit_ssd1675
15
16# Starting in CircuitPython 9.x fourwire will be a seperate internal library
17# rather than a component of the displayio library
18try:
19    from fourwire import FourWire
20except ImportError:
21    from displayio import FourWire
22
23displayio.release_displays()
24
25epd_cs = board.D9
26epd_dc = board.D10
27
28display_bus = FourWire(
29    board.SPI(), command=epd_dc, chip_select=epd_cs, baudrate=1000000
30)
31time.sleep(1)
32
33display = adafruit_ssd1675.SSD1675(display_bus, width=250, height=122, rotation=270)
34
35g = displayio.Group()
36
37with open("/display-ruler.bmp", "rb") as f:
38    pic = displayio.OnDiskBitmap(f)
39    # CircuitPython 6 & 7 compatible
40    t = displayio.TileGrid(
41        pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
42    )
43    # CircuitPython 7 compatible only
44    # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
45    g.append(t)
46
47    display.root_group = g
48
49    display.refresh()
50
51    print("refreshed")
52
53    time.sleep(120)

2.13” Monochrome

Ensure your 2.13” Monochrome breakout works with this simple test.

examples/ssd1675_2.13_monochrome.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4"""Simple test script for 2.13" 250x122 monochrome display.
 5
 6Supported products:
 7  * Adafruit 2.13" Monochrome ePaper Display Breakout
 8    * https://www.adafruit.com/product/4197
 9  """
10
11import time
12import board
13import displayio
14import adafruit_ssd1675
15
16# Starting in CircuitPython 9.x fourwire will be a seperate internal library
17# rather than a component of the displayio library
18try:
19    from fourwire import FourWire
20except ImportError:
21    from displayio import FourWire
22
23
24displayio.release_displays()
25
26# This pinout works on a Feather M4 and may need to be altered for other boards.
27spi = board.SPI()  # Uses SCK and MOSI
28epd_cs = board.D9
29epd_dc = board.D10
30epd_reset = board.D5
31epd_busy = board.D6
32
33display_bus = FourWire(
34    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
35)
36time.sleep(1)
37
38display = adafruit_ssd1675.SSD1675(
39    display_bus, width=250, height=122, rotation=270, busy_pin=epd_busy
40)
41
42g = displayio.Group()
43
44with open("/display-ruler.bmp", "rb") as f:
45    pic = displayio.OnDiskBitmap(f)
46    # CircuitPython 6 & 7 compatible
47    t = displayio.TileGrid(
48        pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
49    )
50    # CircuitPython 7 compatible only
51    # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
52    g.append(t)
53
54    display.root_group = g
55
56    display.refresh()
57
58    print("refreshed")
59
60    time.sleep(120)