小编Fra*_*lla的帖子

如何使用 Python-Can 和 Raspberry 过滤 CAN 总线结果中的 ID

你好,我有一个带有 MCP2515 CAN 总线设备的 Raspberry,为了读取广播的整个值,只有使用 python-can 的 Python 源:

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

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

它是如何工作的?非常感谢您的回复。

python can-bus python-3.x raspberry-pi

4
推荐指数
1
解决办法
8627
查看次数

标签 统计

can-bus ×1

python ×1

python-3.x ×1

raspberry-pi ×1