用于 Adafruit Trellis 板的 CircuitPython 库。
项目描述
介绍
该库将允许您控制Adafruit Trellis Board上的 LED 和读取按钮按下。它将与单个格子板一起使用,或与多达 8 个格子板的矩阵一起使用。
有关更多详细信息,请参阅Adafruit Trellis 学习指南。
依赖项
此驱动程序取决于:
请确保 CircuitPython 文件系统上的所有依赖项都可用。这可以通过下载 Adafruit 库和驱动程序包轻松实现。
从 PyPI 安装
在 Raspberry Pi 等受支持的 GNU/Linux 系统上,您可以从 PyPI本地安装驱动程序。为当前用户安装:
pip3 install adafruit-circuitpython-trellis
要在系统范围内安装(在某些情况下可能需要这样做):
sudo pip3 install adafruit-circuitpython-trellis
要在当前项目的虚拟环境中安装:
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-trellis
使用示例
有关完整使用示例,请参见示例/trellis_simpletest.py。
import time
import busio
from board import SCL, SDA
from adafruit_trellis import Trellis
# Create the I2C interface
i2c = busio.I2C(SCL, SDA)
# Create a Trellis object for each board
trellis = Trellis(i2c) # 0x70 when no I2C address is supplied
# Turn on every LED
print('Turning all LEDs on...')
trellis.led.fill(True)
time.sleep(2)
# Turn off every LED
print('Turning all LEDs off...')
trellis.led.fill(False)
time.sleep(2)
文档
这个库的 API 文档可以在Read the Docs上找到。
有关构建库文档的信息,请查看本指南。
贡献
欢迎投稿! 在帮助这个项目保持受欢迎之前,请阅读我们的行为准则。
项目详情
关
adafruit_circuitpython_trellis -1.3.15-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | bde6396a9310399b1dd28090d74b8f9c5843761798aa886264cc356ae8473246 |
|
| MD5 | 1577b24b5411c8c8ec202bb6a2d62a50 |
|
| 布莱克2-256 | 514b4b8e7f531cc7da30e2ee5616c8be2bb1d99a585a5f57b2215509652709d9 |