为什么我的arduino不能和serial一起工作?

2024-04-27 00:06:19 发布

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

我正试着用wii nunchuk做一只带arduino的老鼠。project在这里。你知道吗

下面是错误消息:photo

如果你想知道我为什么不把这个贴在网页上,那是因为它已经有好几年的历史了,再也没有人在上面写了。你知道吗


Tags: project消息网页错误历史arduino老鼠photo
1条回答
网友
1楼 · 发布于 2024-04-27 00:06:19

在python脚本中,定义串行对象“port”时忘记初始化波特率

# The port to which your Arduino board is connected
port = 'arduino_port'

试试这个

# The port to which your Arduino board is connected
port = serial.Serial('/dev/ttyACM0',9600)  
#or whatever your port is called

相关问题 更多 >