candle(gs_usb)windows驱动程序的python包装器。

candle-driver的Python项目详细描述


蜡烛驱动程序

candle(gs-usb)windows驱动程序的python包装器,该驱动程序已发布here

用于与烛光通信,CANable(与烛光通信firmware)can-usb适配器。

示例用法

importcandle_driver# lists all available candle devicesdevices=candle_driver.list_devices()ifnotlen(devices):print('No candle devices found.')exit()print('Found {} candle devices.'.format(len(devices)))# use first availabel devicedevice=devices[0]print('Device path: {}'.format(device.path()))print('Device name: {}'.format(device.name()))print('Device channels: {}'.format(device.channel_count()))# open device (blocks other processes from using it)device.open()print('Device timestamp: %d'%device.timestamp())# in usec# open first channelch=device.channel(0)ch.set_bitrate(1000000)# or# ch.set_timings(prop_seg=1, phase_seg1=12, phase_seg2=2, sjw=1, brp=3)# start receiving datach.start()# normal framech.write(10,b'abcdefgh')# extended framech.write(10235|candle_driver.CANDLE_ID_EXTENDED,b'abcdefgh')# wait 1000ms for datatry:frame_type,can_id,can_data,extended,ts=ch.read(1000)print('Received {} from ID {} at {}'.format(can_data,can_id,ts))exceptTimeoutError:print('CAN read timeout')# close everythingch.stop()device.close()

许可证

这个项目是在麻省理工学院的许可下授权的-请参阅LICENSE.md文件了解详细信息。

windows c driver是在gplv3许可下获得许可的-有关详细信息,请参见LICENSE文件。

致谢

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

推荐PyPI第三方库


热门话题
Spring Boot Java后端编码的硬代码通用?   java这种洪水填充算法有什么问题?   java将视图类对象作为参数传递给按钮调用的方法(视图)   java如何在Android上的外部类中存储活动的某些部分?   类路径cp./为什么在运行Java时总是必须手动将CWD包含到CP中?   安卓在Java中通过socket高效地发送大int[]   数组之间的java差异。sort()和数组。并行排序()   python Jython作为java游戏的ingame控制台   java如何使不同PC之间的速度(游戏帧率)相同?   在java中为房间分配床位   java如何解决ResultSet关闭后不允许的错误操作   需要等待在加载网页selenium 3.141.5和java 8时找到特定元素   设计模式如何在JAVA中使用带重载的双重分派?   java Android计时器时间表与scheduleAtFixedRate   在jbossportal2的部署阶段出现错误“java.net.SocketException:打开的文件太多”。7.2   调用java axis2 web服务的c#客户端,对象“重置”