Created
June 2, 2025 14:33
-
-
Save gallaugher/c2ed896aaff4e35d906d6d8b2367de09 to your computer and use it in GitHub Desktop.
EYE SPI, ssd1681 eInk, and Pico
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EYESPI & ssd1681 connected to a Pico | |
import time, board, displayio, adafruit_ssd1681 | |
from displayio import FourWire # ← FIXED: Changed from "fourwire import FourWire" | |
displayio.release_displays() | |
# This pinout works on a Feather M4 and may need to be altered for other boards. | |
spi = board.SPI() # Uses SCK and MOSI | |
epd_cs = board.GP17 | |
epd_dc = board.GP21 | |
epd_reset = board.GP15 | |
epd_busy = board.GP2 | |
display_bus = FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000) | |
time.sleep(1) | |
display = adafruit_ssd1681.SSD1681( | |
display_bus, | |
width=200, | |
height=200, | |
busy_pin=epd_busy, | |
highlight_color=0xFF0000, | |
rotation=180, | |
) | |
g = displayio.Group() | |
print("Running eInk code") | |
with open("/display-ruler.bmp", "rb") as f: | |
pic = displayio.OnDiskBitmap(f) | |
t = displayio.TileGrid( | |
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) | |
) | |
g.append(t) | |
display.root_group = g | |
display.refresh() | |
print("refreshed") | |
time.sleep(120) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment