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第三方库


热门话题
Hibernate:jpamodelgen生成java而不是类   java如何在第二次活动结束后显示广告?   javascript如何在linux或windows上将java导出到jar   java One ArrayList添加了2个不同的选项   AmazonWeb服务如何在java中使用AWS Textract检索pdf中存在的表   java为什么RecycleView中的水平项在单击时不起作用?   java计算如果存在映射   java在捕获的组上应用正则表达式   如何使用Java在MySQL的同一个表中插入来自不同类的值   java字符串中最常见的字母(大写和小写)   Spring SessionBean实例正在由java中的多个用户共享   使用Spring Boot将@WebInitParam中的值外部化   java一创建线程就开始执行(多线程)   java是安卓所需的系统权限。意图行动给你打电话?