Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为什么我的arduino不能和serial一起工作?_Python_Arduino - Fatal编程技术网

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

Python 为什么我的arduino不能和serial一起工作?,python,arduino,Python,Arduino,我试着用wii nunchuk做一个带arduino的鼠标。电话在这里 以下是错误消息: 如果您想知道我为什么不在页面上发布此消息,那是因为它已经存在好几年了,没有人再继续了。在python脚本中,您在定义串行对象“端口”时忘记了初始化波特率 试试这个 # The port to which your Arduino board is connected port = serial.Serial('/dev/ttyACM0',9600) #or whatever your port is c

我试着用wii nunchuk做一个带arduino的鼠标。电话在这里

以下是错误消息:


如果您想知道我为什么不在页面上发布此消息,那是因为它已经存在好几年了,没有人再继续了。

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

试试这个

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

请不要添加图片,而是文本。请尝试以管理员身份运行shell
# The port to which your Arduino board is connected
port = serial.Serial('/dev/ttyACM0',9600)  
#or whatever your port is called