python - 尝试通过 Peak USB 从 Python 向 BUSMASTER 发送消息
问题描述
这是代码---
from __future__ import print_function
import can
def send_one():
bus = can.interface.Bus(bustype='pcan', channel='PCAN_USBBUS1', bitrate=500000,state = can.bus.BusState.PASSIVE
)
msg = can.Message(arbitration_id=0xc0ffee,
data=[0, 25, 0, 1, 3, 1, 4, 1],
extended_id=True)
try:
bus.send(msg)
print("Message sent on {}".format(bus.channel_info))
except can.CanError:
print("Message NOT sent")
if __name__ == '__main__':
send_one()
我收到OS
错误,我尝试安装openslide
但没有导入。请帮忙
解决方案
推荐阅读
- reactjs - 警告:无法对未安装的组件执行 React 状态更新......componentWillUnmount 方法
- python - Pandas 只合并 SQLite 数据库中的新数据
- python - 如何将 matplotlib.pypot 图保存为具有所需像素大小的图像?
- actions-on-google - 在自定义谷歌操作中使用个性化信息
- r - 如何从 GEO 数据库中提取单细胞 RNA 测序数据?
- android - Play Store rejecting app bundle for required automotive feature, but the feature is not marked as required in manifest
- android - 颤振谷歌地图android构建失败
- python - 在 python3.6 中使用 asyncio 忽略 set_exception_handler
- github - Github 不会在提交附近显示新的 travis 构建
- php - PHP - 在另一个范围内访问 $conn 变量