SSD1306 OLED显示器的CircuitPython库。

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


简介

Documentation StatusDiscordBuild Status

用于SSD1306或SSD1305 OLED显示器的Adafruit CircuitPython驱动程序。注意,ssd1305显示器是向后兼容的,因此它们可以用相同的代码和命令代替ssd1306。

此驱动程序基于micropython源代码中的ssd1306驱动程序,但不同于 通过支持硬件I2C接口和Adafruit CircuitPythonAPI。为了一个 micropython机器api兼容库参见:https://github.com/adafruit/micropython-adafruit-ssd1306

依赖关系

此驱动程序取决于:

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

用法示例

# Basic example of clearing and drawing pixels on a SSD1306 OLED display.# This example and library is meant to work with Adafruit CircuitPython API.# Author: Tony DiCola# License: Public Domain# Import all board pins.fromboardimportSCL,SDAimportbusio# Import the SSD1306 module.importadafruit_ssd1306# Create the I2C interface.i2c=busio.I2C(SCL,SDA)# Create the SSD1306 OLED class.# The first two parameters are the pixel width and pixel height.  Change these# to the right size for your display!display=adafruit_ssd1306.SSD1306_I2C(128,32,i2c)# Alternatively you can change the I2C address of the device with an addr parameter:#display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, addr=0x31)# Clear the display.  Always call show after changing pixels to make the display# update visible!display.fill(0)display.show()

贡献

欢迎投稿!请阅读我们的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-ssd1306 --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 Boot 2.2.0中添加弹性搜索?   jakarta ee如何在没有java认证的情况下停止直接访问网页(自定义标记)   java Hibernate:使用executeUpdate()的批删除未清除一级缓存   java如何在Hibernate中插入外键定义为Long的实体?   带参数的java Mockito单元测试计算器方法   java如何从Rally Rest API读取集合属性   java如何对基于消息的处理执行集成测试?   带插入排序的java排序字符串数组标记,双链表   java为什么在基于注释的Spring app@Value默认值中解析为null?   java Apache Commons Http客户端注册特定于客户端的协议   如何使用java反转字符串中n个部分的n个字符   java Tomcat在本地主机上运行良好,但在部署时出现内部服务器错误   使用信号量的变量的java结果   Java编译/运行时类路径问题   java哪个提供商负责AES/CTR/NOP添加?   伪错误解码器中的java响应未获取Zalando问题自定义属性