用于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为引用变量指定默认值   java在2D数组中旋转innersquare   java将hashmap键值与int进行比较   java程序中的并发监视器陷入死锁   安卓 java。lang.NoClassDefFoundError:java。awt。光标   java有没有更好的方法来引用包含对象的对象?   如何在Java编程中循环代码块   java如何在Junit5中使用Serenity?   java使用ANTLR识别JavaScript文件中的全局变量声明   EJB查询对象生成的java视图SQL?   java查找股票报价的范围   java错误:(453,69)不允许使用字符串类型(在值为“”的“活动\u水平\u边距”处)   java安装的环境变量   amazon web服务在使用awssdkjava上载到S3存储桶时发生直接错误   java在Android的ArrayList中添加相等的值   尝试打开MyEclipse Enterprise Workbench时出现ide“无法创建java虚拟机”错误   java如何使用单元格指定的行和列更改jTable的单元格颜色?   java如何等待文件从系统目录复制到具有根访问权限的外部存储