Simple test

Ensure your device works with this simple test.

examples/spd1656_simpletest.py
 1# SPDX-FileCopyrightText: Copyright (c) 2023 Scott Shawcroft 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 5.6" 600x448 7-color ACeP display."""
 7
 8import time
 9
10import board
11import displayio
12import fourwire
13
14import adafruit_spd1656
15
16displayio.release_displays()
17
18# This pinout works on a Feather RP2040 and may need to be altered for other boards.
19spi = board.SPI()  # Uses SCK and MOSI
20epd_cs = board.D9
21epd_dc = board.D10
22epd_reset = board.D11
23epd_busy = board.D12
24
25display_bus = fourwire.FourWire(
26    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
27)
28
29display = adafruit_spd1656.SPD1656(display_bus, width=600, height=448, busy_pin=epd_busy)
30
31g = displayio.Group()
32
33pic = displayio.OnDiskBitmap("/display-ruler-720p.bmp")
34t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
35g.append(t)
36
37display.root_group = g
38
39display.refresh()
40
41time.sleep(120)

Stripes test

Show stripes with each of the colors that can be displayed

examples/spd1656_color_stripes.py
 1# SPDX-FileCopyrightText: Copyright (c) 2023 Tim Cocks for Adafruit Industries
 2#
 3# SPDX-License-Identifier: Unlicense
 4
 5"""Stripes test script for 5.6" 600x448 7-color ACeP display.
 6Fill the screen with striped rows, one for each possible color.
 7"""
 8
 9import bitmaptools
10import board
11import displayio
12import fourwire
13
14import adafruit_spd1656
15
16displayio.release_displays()
17
18# This pinout works on a Feather RP2040 and may need to be altered for other boards.
19spi = board.SPI()  # Uses SCK and MOSI
20epd_cs = board.D9
21epd_dc = board.D10
22epd_reset = board.D11
23epd_busy = board.D12
24
25display_bus = fourwire.FourWire(
26    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
27)
28
29display = adafruit_spd1656.SPD1656(display_bus, width=600, height=448, busy_pin=epd_busy)
30
31g = displayio.Group()
32
33bmp = displayio.Bitmap(display.width, display.height, 7)
34p = displayio.Palette(7)
35p[0] = 0xFFFFFF
36p[1] = 0x000000
37p[2] = 0x0000FF
38p[3] = 0x00FF00
39p[4] = 0xFF0000
40p[5] = 0xFFFF00
41p[6] = 0xFFA500
42
43bmp.fill(0)
44
45for i in range(7):
46    bitmaptools.fill_region(
47        bmp,
48        0,
49        i * (display.height // 7),
50        display.width,
51        i * (display.height // 7) + (display.height // 7),
52        i,
53    )
54
55tg = displayio.TileGrid(bitmap=bmp, pixel_shader=p)
56g.append(tg)
57
58display.root_group = g
59
60display.refresh()
61
62while True:
63    pass

Colors and Text Example

Display a filled colored rectangle with a different border color and test layered on top in the center.

examples/spd1656_colors_and_text.py
 1# SPDX-FileCopyrightText: Copyright (c) 2023 Tim Cocks for Adafruit Industries
 2#
 3# SPDX-License-Identifier: Unlicense
 4
 5"""Colors and Text script for 5.6" 600x448 7-color ACeP display.
 6Draw a border and screen filled with color and layer text on top
 7of it.
 8"""
 9
10import bitmaptools
11import board
12import displayio
13import fourwire
14import terminalio
15from adafruit_display_text.bitmap_label import Label
16
17import adafruit_spd1656
18
19displayio.release_displays()
20
21# This pinout works on a Feather RP2040 and may need to be altered for other boards.
22spi = board.SPI()  # Uses SCK and MOSI
23epd_cs = board.D9
24epd_dc = board.D10
25epd_reset = board.D11
26epd_busy = board.D12
27
28display_bus = fourwire.FourWire(
29    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
30)
31
32display = adafruit_spd1656.SPD1656(display_bus, width=600, height=448, busy_pin=epd_busy)
33
34g = displayio.Group()
35
36bmp = displayio.Bitmap(display.width, display.height, 7)
37p = displayio.Palette(7)
38p[0] = 0xFFFFFF
39p[1] = 0x000000
40p[2] = 0x0000FF
41p[3] = 0x00FF00
42p[4] = 0xFF0000
43p[5] = 0xFFFF00
44p[6] = 0xFFA500
45
46bmp.fill(2)
47
48bitmaptools.fill_region(bmp, 40, 40, display.width - 40, display.height - 40, 3)
49tg = displayio.TileGrid(bitmap=bmp, pixel_shader=p)
50g.append(tg)
51
52lbl = Label(terminalio.FONT, text="Hello World", color=0xFFFFFF, scale=3)
53lbl.anchor_point = (0.5, 0.5)
54lbl.anchored_position = (display.width // 2, display.height // 2)
55g.append(lbl)
56
57display.root_group = g
58display.refresh()
59
60while True:
61    pass