如何用PythonCan和Raspberry对canBus的结果进行过滤

2024-05-29 12:03:45 发布

您现在位置:Python中文网/ 问答频道 /正文

您好,我有一个带有MCP2515 can总线设备的树莓,要读取整个广播值,只有在Python中使用Python的此源才能:

import can 
bus = can.interface.Bus(channel='can0', bustype='socketcan_native') 
notifier = can.Notifier(bus, [can.Printer()])

我需要过滤id的结果,它是如何工作的?有人能举个例子说明它有可能做个过滤器吗?我在图书馆的网站上看到了这是过滤的网页: https://python-can.readthedocs.io/en/stable/bus.html#filtering

它是怎么工作的?非常感谢你的回复。在


Tags: importchannelcaninterface树莓notifiernative总线

热门问题