Skip to main content

用于 SSD1305 显示器的 Framebuf(非 displayio)驱动程序

项目描述

介绍

文件状态 不和谐 构建状态 代码风格:黑色

用于 SSD1305 显示器的 Framebuf(非 displayio)驱动程序

依赖项

此驱动程序取决于:

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

从 PyPI 安装

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

pip3 install adafruit-circuitpython-ssd1305

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

sudo pip3 install adafruit-circuitpython-ssd1305

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

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

使用示例

# Basic example of clearing and drawing pixels on a SSD1305 OLED display.
# This example and library is meant to work with Adafruit CircuitPython API.
# Author: Tony DiCola
# License: Public Domain

# Import all board pins.
from board import SCL, SDA
import busio

# Import the SSD1305 module.
import adafruit_ssd1305


# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)

# Create the SSD1305 OLED class.
# The first two parameters are the pixel width and pixel height.  Change these
# to the right size for your display!
display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c)
# Alternatively you can change the I2C address of the device with an addr parameter:
#display = adafruit_ssd1305.SSD1305_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()

文档

这个库的 API 文档可以在Read the Docs上找到。

有关构建库文档的信息,请查看本指南

贡献

欢迎投稿! 在帮助这个项目保持受欢迎之前,请阅读我们的行为准则。

项目详情


下载文件

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

源分布

adafruit-circuitpython-ssd1305-1.3.14.tar.gz (31.3 kB 查看哈希)

已上传 source

内置分布

adafruit_circuitpython_ssd1305-1.3.14-py3-none-any.whl (6.9 kB 查看哈希

已上传 py3