跳转到主要内容

CircuitPython库,用于EPD电子墨水显示屏。

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

此库用于使用带有内置SRAM的电子墨水显示屏与CircuitPython一起使用。

依赖项

此驱动程序依赖于

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

从PyPI安装

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

pip3 install adafruit-circuitpython-epd

为系统范围内安装(在某些情况下可能需要这样做)

sudo pip3 install adafruit-circuitpython-epd

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

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

用法示例

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
from adafruit_epd.il0373 import Adafruit_IL0373

# create the spi device and pins we will need
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.D12)
dc = digitalio.DigitalInOut(board.D11)
srcs = digitalio.DigitalInOut(board.D10)    # can be None to use internal memory
rst = digitalio.DigitalInOut(board.D9)    # can be None to not use this pin
busy = digitalio.DigitalInOut(board.D5)   # can be None to not use this pin

# give them all to our driver
print("Creating display")
display = Adafruit_IL0373(104, 212, spi,          # 2.13" Tri-color display
                          cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
                          rst_pin=rst, busy_pin=busy)

display.rotation = 1

# clear the buffer
print("Clear buffer")
display.fill(Adafruit_EPD.WHITE)
display.pixel(10, 100, Adafruit_EPD.BLACK)

print("Draw Rectangles")
display.fill_rect(5, 5, 10, 10, Adafruit_EPD.RED)
display.rect(0, 0, 20, 30, Adafruit_EPD.BLACK)

print("Draw lines")
display.line(0, 0, display.width-1, display.height-1, Adafruit_EPD.BLACK)
display.line(0, display.height-1, display.width-1, 0, Adafruit_EPD.RED)

print("Draw text")
display.text('hello world', 25, 10, Adafruit_EPD.BLACK)
display.display()

文档

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

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

贡献

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

项目详情


下载文件

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

源分发

adafruit-circuitpython-epd-2.12.2.tar.gz (44.5 kB 查看哈希值)

上传时间

构建分发

adafruit_circuitpython_epd-2.12.2-py3-none-any.whl (31.0 kB 查看哈希值)

上传时间 Python 3

由以下机构支持

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