用于EPD E-ink显示的CircuitPython库。

adafruit-circuitpython-epd的Python项目详细描述


简介

Documentation StatusDiscordBuild Status

此库用于将circuitpython与内置sram的e-ink显示器一起使用。

依赖关系

此驱动程序取决于:

请确保circuitpython文件系统上的所有依赖项都可用。 这很容易通过下载来实现 the Adafruit library and driver bundle

用法示例

importdigitalioimportbusioimportboardfromadafruit_epd.epdimportAdafruit_EPDfromadafruit_epd.il0373importAdafruit_IL0373# create the spi device and pins we will needspi=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 memoryrst=digitalio.DigitalInOut(board.D9)# can be None to not use this pinbusy=digitalio.DigitalInOut(board.D5)# can be None to not use this pin# give them all to our driverprint("Creating display")display=Adafruit_IL0373(104,212,spi,# 2.13" Tri-color displaycs_pin=ecs,dc_pin=dc,sramcs_pin=srcs,rst_pin=rst,busy_pin=busy)display.rotation=1# clear the bufferprint("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()

贡献

欢迎投稿!请阅读我们的Code of Conduct 在帮助这个项目保持热情之前。

本地建筑

压缩发布文件

要在本地构建此库,您需要安装 circuitpython-build-tools包装。

python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools

安装后,请确保您处于虚拟环境中:

source .env/bin/activate

然后运行生成:

circuitpython-build-bundles --filename_prefix adafruit-circuitpython-epd --library_location .

斯芬克斯文件

sphinx用于根据代码中的rst文件和注释构建文档。第一, 安装依赖项(请随意重用上面的虚拟环境):

python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme

现在,激活虚拟环境后:

cd docs
sphinx-build -E -W -b html . _build/html

这将把文档输出到docs/_build/html。在浏览器中打开index.html以 查看它们。它还将(由于-w)错误的任何警告,像特拉维斯将。这是个很好的方法 本地验证它将通过。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像