跳转到主要内容

CircuitPython库,用于Adafruit Trellis板。

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

此库将允许您控制Adafruit Trellis板上的LED和读取按钮按压。它可以与单个Trellis板一起使用,也可以与最多8个Trellis板的矩阵一起使用。

有关更多详细信息,请参阅Adafruit Trellis学习指南

依赖项

此驱动程序依赖于

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

从PyPI安装

在支持GNU/Linux系统(如Raspberry Pi)上,您可以从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

使用示例

有关完整使用示例,请参阅examples/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.19.tar.gz (28.3 kB 查看散列值)

上传时间

构建分布

adafruit_circuitpython_trellis-1.3.19-py3-none-any.whl (6.8 kB 查看散列值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面