libbox0绑定

box0的Python项目详细描述


Pybox0

libbox0的python绑定

依赖关系

  • CFFI
  • 努比

在C中:

  • libbox0

安装

$python setup.py生成 $python setup.py安装

配置

在local.properties中 _ binding.py,构建路径变量以指示在何处查找头和库

用法

在test/和example中有很多演示代码/ 打开设备和模块并对其执行操作的通用方法

import box0

# open any supported usb device
dev = box0.usb.open_supported()

# open the dio0 module (assuming the device support it)
# if you need to iterate over the supported modules using dev
dio0 = dev.dio(0)

# Prepare for basic mode (basic functionality)
dio0.basic_prepare()

# set to output mode
dio0.dir(0, dio0.OUTPUT)

# set value of pin 0
dio0.value(0, dio0.LOW)

#disable hiz mode of pin 0,
# note: all pins are in hiz mode right after opening (for protection)
dio0.hiz(0, dio0.DISABLE)

# start the basic mode
dio0.basic_start()

# wait
try:
	while True:
		time.sleep(.5)
except:
	pass

# Stop basic mode
dio0.basic_stop()

# close resources
dio0.close()
dev.close()

pybox0使用与libbox0相同的样式,并且 libbox0的许多文档都适用于pybox0

int b0_<section>_<func>(<section-object>, params....)

在Pybox0中: 当int val<;0时出现异常(resultexception),而不是int 因此,现在返回值用于其他任务

"b0" tag is now replace with "box0." as python have concept of modules

<section> is replace with files.
	for example: <section> = "device" , theirs device.py
		and it contain Device.py


<func> these are under-scored style name in libbox0
	in pyBox0, camelcasing is used
	for example b0_usb_open_supported() is box0.usb.open_supported()

most of the library assumes numpy array.
	numpy is good and you should always use numpy with pyBox0 as
	it much better in long run

获取帮助

进入irc freenode上的box0 在https://gitlab.com/madresistor/pyBox0

上报告错误

参与

进入irc freenode上的box0 在https://gitlab.com/madresistor/pyBox0

上报告错误

许可证

GNU/GPLv3或更高版本(请参阅复制)

学分和参考资料

https://www.madresistor.com/

维修人员

库尔德普·辛格·达卡kuldeep@madresistor.com

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

推荐PyPI第三方库


热门话题
javascript生成两点之间的固定纬度和经度   java为什么不删除并重命名文件?   求数组的和   java在漂亮面孔中使用正则表达式   SOAP(java)中的Hello World。如何修复它?   java I获取应用程序生成错误,配置为“”的资源“attr/arc_position”的值重复   云基础环境中的Java SFTP客户端应用   谷歌应用程序引擎Java查询日期不正常?   java使用cancel按钮对JOptionPane InputDialog循环进行转义   java数字格式总是返回异常   xquery Java Saxon API以“追加”模式写入文件   java Azure函数在第二个插槽中没有响应   java在构建Play应用程序后向其添加动态依赖项   json如何使用Jackson mapper for java。木卫一。可序列化类型字段?