arduino simplerpc api客户端库和cli。

arduino-simple-rpc的Python项目详细描述


https://img.shields.io/github/last-commit/jfjlaros/arduino-simple-rpc.svghttps://travis-ci.org/jfjlaros/arduino-simple-rpc.svg?branch=masterhttps://readthedocs.org/projects/simplerpc/badge/?version=latesthttps://img.shields.io/github/release-date/jfjlaros/arduino-simple-rpc.svghttps://img.shields.io/github/release/jfjlaros/arduino-simple-rpc.svghttps://img.shields.io/pypi/v/arduino-simple-rpc.svghttps://img.shields.io/github/languages/code-size/jfjlaros/arduino-simple-rpc.svghttps://img.shields.io/github/languages/count/jfjlaros/arduino-simple-rpc.svghttps://img.shields.io/github/languages/top/jfjlaros/arduino-simple-rpc.svghttps://img.shields.io/github/license/jfjlaros/arduino-simple-rpc.svg

这个库提供了一种简单的方法来连接导出的Arduino函数 使用simpleRPC协议。导出的方法定义被传达 到主机,然后主机可以使用 图书馆。

功能:

  • 用户友好的api库。
  • 用于方法发现和测试的命令行界面(cli)。
  • 函数名和参数名在arduino上定义。
  • API文档在Arduino上定义。
  • 支持断开和重新连接。

请参阅ReadTheDocs获取最新文档。

快速启动

导出上的任何函数,例如digitalRead()digitalWrite()。 arduino,这些函数将显示为^{tt3}的成员函数$ 类实例。

首先,我们创建一个Interface类实例,并告诉它连接到 串行设备/dev/ttyACM0

>>>fromsimple_rpcimportInterface>>>>>>interface=Interface('/dev/ttyACM0')

我们可以使用内置的help()函数查看任何 导出的方法。

>>>help(interface.digital_read)Helponmethoddigital_read:digital_read(pin)methodofsimple_rpc.simple_rpc.InterfaceinstanceReaddigitalpin.:argintpin:Pinnumber.:returnsint:Pinvalue.

所有公开的方法都可以像任何其他类方法一样调用。

>>>interface.digital_read(8)# Read from pin 8.0>>>interface.digital_write(13,True)# Turn LED on.

进一步阅读

有关主机库和其他接口的详细信息,请参见 UsageLibrary部分。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Samsung远程测试实验室(RTL):如何将设备绑定到Eclipse/debugger   java XSSFCellStyle在LibreOffice Calc Ubuntu中不起作用   java junit测试错误ClassCastException   java Libgdx:如何删除表中的边框   java如何在处理中创建多色光栅化图片   java可以在JSF 2.0中级联ajax呈现的内容吗?   java Exit menuitem在内部框架中不工作   java向JPanel添加未知数量的JComponents   mongodb Mongo group by query转换为java   java没有GestureDetector的实现可以在安卓应用程序上运行   java Spring mvc,hibernate LazyInitializationException将实体转换为dto时出现异常   java中棘手的方法重载   java如何在SpringMVC中验证数字字段中的非数字输入?   Java ElasticSearch高级客户端的使用问题:SortedNumericIndexFieldData无法转换为类IndexGeoPointFieldData