Simple test
Ensure your device works with this simple test.
examples/ssd1608_simpletest.py
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4"""Simple test script for 1.54" 200x200 monochrome display.
5
6Supported products:
7 * Adafruit 1.54" Monochrome ePaper Display Breakout
8 * https://www.adafruit.com/product/4196
9"""
10
11import time
12
13import board
14import displayio
15import fourwire
16
17import adafruit_ssd1608
18
19displayio.release_displays()
20
21# This pinout works on a Feather M4 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.D5
26epd_busy = board.D6
27
28display_bus = fourwire.FourWire(
29 spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
30)
31time.sleep(1)
32
33display = adafruit_ssd1608.SSD1608(
34 display_bus, width=200, height=200, busy_pin=epd_busy, rotation=180
35)
36
37g = displayio.Group()
38
39pic = displayio.OnDiskBitmap("/display-ruler.bmp")
40t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
41g.append(t)
42
43display.root_group = g
44
45display.refresh()
46
47print("refreshed")
48
49time.sleep(120)