跳转到主要内容

CircuitPython `displayio` 驱动程序,用于基于SSD1681的电子纸显示屏

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

CircuitPython displayio 驱动程序,用于SSD1681电子纸显示屏

依赖项

此驱动程序依赖于

请确保所有依赖项都在CircuitPython文件系统中可用。这可以通过下载 Adafruit库和驱动程序包 或使用 circup 安装单个库来实现。

Adafruit 1.54” 三色电子墨水/电子纸 200x200 显示屏(带SRAM)

在Adafruit商店购买

从PyPI安装

在支持GNU/Linux的系统(如Raspberry Pi)上,您可以从PyPI本地安装驱动程序 要为当前用户安装

pip3 install adafruit-circuitpython-ssd1681

要全局安装(在某些情况下可能需要)

sudo pip3 install adafruit-circuitpython-ssd1681

要在当前项目的虚拟环境中安装

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-ssd1681

使用示例

import time
import board
import displayio
import fourwire
import adafruit_ssd1681

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.D9
epd_dc = board.D10
epd_reset = board.D5
epd_busy = board.D6

display_bus = fourwire.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, rotation=180
)

g = displayio.Group()

# CircuitPython 6 & 7 compatible
f = open("/display-ruler.bmp", "rb")
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(
    pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
)

# # CircuitPython 7 compatible only
# pic = displayio.OnDiskBitmap("/display-ruler.bmp")
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)

g.append(t)

display.root_group = g

display.refresh()
print("refreshed")

time.sleep(120)

文档

该库的API文档可以在 Read the Docs 上找到。

有关构建库文档的信息,请参阅本指南

贡献

欢迎贡献!在为此项目做出贡献之前,请阅读我们的行为准则,以帮助保持项目的友好氛围。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源分布

adafruit-circuitpython-ssd1681-1.2.2.tar.gz (33.0 kB 查看散列)

上传时间

构建分布

adafruit_circuitpython_ssd1681-1.2.2-py3-none-any.whl (5.3 kB 查看散列)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页