binho多协议usb主机适配器的python库
binho-host-adapter的Python项目详细描述
binho主机适配器python库
简介
用于自动控制Binho多协议USB主机适配器的跨平台Python3.x库。有关该设备的更多信息,请访问https://www.binho.io
依赖性
此库需要pySerial才能跨平台访问串行端口。此库将由PIP自动安装,但为了便于参考,只需运行以下命令即可手动安装:
pip install pyserial
安装
使用以下命令可以轻松安装此库:
pip install binho-host-adapter
示例用法
frombinhoHostAdapterimportbinhoHostAdapterfrombinhoHostAdapterimportbinhoUtilitiesprint("Demo Script with Binho Host Adapter Python Libraries")printutilities=binhoUtilities.binhoUtilities()devices=utilities.listAvailableDevices()iflen(devices)==0:print("No Devices Found!")exit()eliflen(devices)==1:COMPORT=devices[0]print("Found 1 attached adapter @ "+devices[0])printelse:COMPORT=devices[0]print("Found more than 1 attached adapter, using first device found on "+COMPORT)printprint("Opening "+COMPORT+"...")print# create the binhoHostAdapter objectbinho=binhoHostAdapter.binhoHostAdapter(COMPORT)print("Connecting to host adapter...")print(binho.getDeviceID())print
文件
这个python库的完整文档集可以在https://support.binho.io/python-libraries