用于红外发射和接收的circuitpython库。

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


简介

Documentation StatusDiscordBuild Status

用于红外接收器的circuitpython驱动程序。

使用此库的产品示例:

依赖关系

此驱动程序取决于:

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

用法示例

# Circuit Playground Express Demo Code# Adjust the pulseio 'board.PIN' if using something elseimportpulseioimportboardimportadafruit_irremotepulsein=pulseio.PulseIn(board.REMOTEIN,maxlen=120,idle_state=True)decoder=adafruit_irremote.GenericDecode()# size must match what you are decoding! for NEC use 4received_code=bytearray(4)whileTrue:pulses=decoder.read_pulses(pulsein)print("Heard",len(pulses),"Pulses:",pulses)try:code=decoder.decode_bits(pulses,debug=False)print("Decoded:",code)exceptadafruit_irremote.IRNECRepeatException:# unusual short code!print("NEC repeat!")exceptadafruit_irremote.IRDecodeExceptionase:# failed to decodeprint("Failed to decode: ",e.args)print("----------------------------")

贡献

欢迎投稿!请阅读我们的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-irremote --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使用McClickListener单击了什么元素   Java时间戳在Oracle时间戳中不同情况下存储12 PM的奇怪行为   java无法使用事件总线对运行在不同机器上的垂直体进行通信   java Mockserver:收到请求后进行回调   java无法将Json字符串转换为Map<string,Object>   java如何按升序排列输出?   java视图行,带有oracle键。jbo。在SrCategoryParentIterator中找不到键[300100120394155]   javafxmysql连接示例   java正在等待加载完成   java是否可以将同一个有状态会话bean实例注入多个其他会话bean?   java无法让万向节检测离开或进入区域   使用JavaCV和OpenCV的java提供了dyld:lazy符号绑定失败:找不到符号:__sincos_stret   xml解析无法使用Java读取xml文档   java无法更改工具栏的颜色   javaapachesshd和JSCH   java无法在firebase存储中检索图像url   java问题与executeUpdate   同一应用程序中不同活动之间的java SharedReference