使用 pymata4 库时出现串行错误

问题描述 投票:0回答:1

我正在使用 pymata4 库通过 python 对 Arduino 进行配置。该项目运行良好,但几个月后,当我尝试运行它时,它显示了串行属性错误。

enter image description here 打开 COM3... 回溯(最近一次调用最后一次): 文件“c:\Users\DELL\Desktop\盲文键盘 eal Keyboard.py”,第 4 行,在 板 = pymata4.Pymata4('COM3') 文件“C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\pymata4\pymata4.py”,第 242 行,位于 init self._manual_open() 文件“C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\pymata4\pymata4.py”,第 417 行,位于 _manual_open self.serial_port = serial.Serial(self.com_port, self.baud_rate, 属性错误:模块“串行”没有属性“串行”

有什么建议如何解决吗?

我试图运行 pymata4 代码,该代码在几个月前运行良好,但现在无法运行。

python pyserial
1个回答
0
投票

pymata4
已被冻结3年。 PySerial 模块已更改其公共接口。您可以尝试调整代码以使用
serial_for_url
,或者您可以按照软件包作者的建议进行操作并移至 Telemetrix:

https://github.com/MrYsLab/pymata4?tab=readme-ov-file

© www.soinside.com 2019 - 2024. All rights reserved.