基于EK79686的电子纸显示屏的CircuitPython `displayio` 驱动器
项目描述
简介
CircuitPython displayio 驱动器,用于基于EK79686的电子纸显示屏
依赖项
此驱动器依赖于
请确保所有依赖项都可在CircuitPython文件系统中使用。这可以通过下载Adafruit库和驱动器包或使用circup安装单个库轻松实现。
从PyPI安装
在支持GNU/Linux系统(如树莓派)上,您可以从PyPI本地安装驱动器。要为当前用户安装
pip3 install adafruit-circuitpython-ek79686
要全局安装(在某些情况下可能需要)
sudo pip3 install adafruit-circuitpython-ek79686
要在当前项目的虚拟环境中安装
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install adafruit-circuitpython-ek79686
使用Circup在连接的CircuitPython设备上安装
确保您已将circup安装到Python环境中。如果需要,请使用以下命令安装它
pip3 install circup
安装circup后,将您的CircuitPython设备连接到计算机,然后使用以下命令进行安装
circup install adafruit_ek79686
或以下命令更新现有版本
circup update
使用示例
import time
import board
import displayio
import adafruit_ek79686
# Used to ensure the display is free in CircuitPython
displayio.release_displays()
# Define the pins needed for display use on the Metro
spi = board.SPI()
epd_cs = board.D10
epd_dc = board.D9
epd_reset = board.D5
epd_busy = board.D6
# Create the displayio connection to the display pins
display_bus = displayio.FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1) # Wait a bit
# Create the display object - the third color is red (0xff0000)
display = adafruit_ek79686.EK79686(
display_bus,
width=264,
height=176,
busy_pin=epd_busy,
highlight_color=0xFF0000,
rotation=90,
)
# Create a display group for our screen objects
g = displayio.Group()
# Display a ruler graphic from the root directory of the CIRCUITPY drive
with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)
# Create a Tilegrid with the bitmap and put in the displayio group
# CircuitPython 6 & 7 compatible
t = displayio.TileGrid(
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
)
# CircuitPython 7 compatible only
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
# Place the display group on the screen (does not refresh)
display.show(g)
# Show the image on the display
display.refresh()
print("refreshed")
# Do Not refresh the screen more often than every 180 seconds
# for eInk displays! Rapid refreshes will damage the panel.
time.sleep(180)
文档
该库的API文档可以在Read the Docs上找到。
有关构建库文档的信息,请参阅本指南。
贡献
欢迎贡献!请在贡献之前阅读我们的行为准则,以帮助本项目保持友好。
项目详情
关闭
adafruit-circuitpython-ek79686-1.1.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a6e5404bbae73d8f300bbc691df588ea9c3b4023fb8baeacd1fcbd0aa2d3e57b |
|
MD5 | 597d8e45e77d50abc64fee16229d5c24 |
|
BLAKE2b-256 | ca12ce0f779b4ca275f27c65eb0be48977059949a48bc94a133c47f056c942ed |
关闭
adafruit_circuitpython_ek79686-1.1.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8bfa4b02cd9d5f90f70a228fb594f3c81a23a42e53fc4e0b66b18dd22b71b483 |
|
MD5 | 62010d60b3ae2cc2eb2c29008796c163 |
|
BLAKE2b-256 | a75fe620e546f58386f9a680cc7d3920d56d21e2ee35e2affb1399a84f5b391d |