CircuitPython LED颜色和动画的辅助工具。
项目描述
简介
执行各种LED动画任务
依赖项
此驱动程序依赖于
请确保所有依赖项都在CircuitPython文件系统中可用。这可以通过下载 Adafruit库和驱动程序包 来轻松实现。
从PyPI安装
在支持GNU/Linux系统(如Raspberry Pi)上,您可以从PyPI 安装驱动程序。为当前用户安装
pip3 install adafruit-circuitpython-led-animation
为了全局安装(在某些情况下可能需要)
sudo pip3 install adafruit-circuitpython-led-animation
在当前项目的虚拟环境中安装
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-led-animation
使用示例
import board
import neopixel
from adafruit_led_animation.animation.blink import Blink
import adafruit_led_animation.color as color
# Works on Circuit Playground Express and Bluefruit.
# For other boards, change board.NEOPIXEL to match the pin to which the NeoPixels are attached.
pixel_pin = board.NEOPIXEL
# Change to match the number of pixels you have attached to your board.
num_pixels = 10
pixels = neopixel.NeoPixel(pixel_pin, num_pixels)
blink = Blink(pixels, 0.5, color.PURPLE)
while True:
blink.animate()
文档
此库的API文档可以在 Read the Docs 上找到。
有关构建库文档的信息,请参阅 本指南。
贡献
欢迎贡献力量!在为该项目贡献力量之前,请阅读我们的行为准则,以帮助保持项目的友好氛围。
本地构建
ZIP发布文件
要本地构建此库,您需要安装circuitpython-build-tools包。
python3 -m venv .venv
source .venv/bin/activate
pip install circuitpython-build-tools
安装完成后,确保您处于虚拟环境中
source .venv/bin/activate
然后运行构建
circuitpython-build-bundles --filename_prefix circuitpython-led_animation --library_location .
Sphinx文档
Sphinx用于根据rST文件和代码中的注释构建文档。首先,安装依赖项(您可以重复使用上面的虚拟环境)
python3 -m venv .venv
source .venv/bin/activate
pip install Sphinx sphinx-rtd-theme
现在,一旦激活了虚拟环境
cd docs
sphinx-build -E -W -b html . _build/html
这将输出文档到docs/_build/html。在浏览器中打开index.html以查看它们。它还会由于-W而错误地输出任何警告,就像Travis一样。这是一种在本地验证其是否通过的好方法。
项目详情
关闭
哈希值 for adafruit_circuitpython_led_animation-2.9.2.tar.gz
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 647af430f2fb7758db40de00d32833c4ebc9c50fbf8070eae3438617732d11bc |
|
MD5 | db1d89c1bdb721d2550f234eb7ec5764 |
|
BLAKE2b-256 | 8b7ad67b1a5fc3937e86656cda6324c181a3ebe7cae30b3d608cabf150af3fb3 |
关闭
哈希值 for adafruit_circuitpython_led_animation-2.9.2-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0ebbfba520915a10e518514ca134ce17e19c2a276fda16b388d080da90b10e25 |
|
MD5 | eacff778be6d9309ec372939f33c5244 |
|
BLAKE2b-256 | a55d2f124b943f4c79913b309729eccb5d7af55b944d65738e7b1d27dd0a8614 |