ser.read公司()有用,但是读写线()投掷

2024-04-19 00:52:05 发布

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

我试图用Python从一个Arduino读取序列值。在

>>> ser.read()
'2'
>>> a = ser.readLine()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Serial' object has no attribute 'readLine'

为什么readLine有错误,read()却没有?或者读(10)?在

我使用的完整代码:

^{pr2}$

Tags: inmostreadreadlinestdinline序列call