跳转到主要内容

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

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

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

依赖项

此驱动程序依赖于

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

  • Adafruit 2.13” 250x122 三色电子墨水/电子纸显示屏 - SSD1680驱动程序

从Adafruit商店购买Breakout

  • Adafruit 2.13” 高清三色电子墨水/电子纸显示屏FeatherWing - 250x122 RW面板,带SSD1680

从Adafruit商店购买FeatherWing

从PyPI安装

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

pip3 install adafruit-circuitpython-ssd1680

要系统范围安装(在某些情况下可能需要)

sudo pip3 install adafruit-circuitpython-ssd1680

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

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

使用示例

import time
import board
import displayio
import fourwire
import adafruit_ssd1680

displayio.release_displays()

# This pinout works on a Metro 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.D8    # Set to None for FeatherWing
epd_busy = board.D7    # Set to None for FeatherWing

display_bus = fourwire.FourWire(
    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)

display = adafruit_ssd1680.SSD1680(
    display_bus,
    width=250,
    height=122,
    busy_pin=epd_busy,
    highlight_color=0xFF0000,
    rotation=270,
)

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_ssd1680-1.2.3.tar.gz (33.7 kB 查看哈希)

上传时间: 源代码

构建分发

adafruit_circuitpython_ssd1680-1.2.3-py3-none-any.whl (5.4 kB 查看哈希)

上传时间: Python 3

由以下机构支持

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