Why does the port com used on the computer display an error when running on the Raspberry Pi?

Why does the port name used in the .py program on the computer display a port error when running on the Raspberry Pi?

1.树莓派USB端口号的表示方式与电脑端并不同,电脑端通常为如 'COM1’和’COM2’的形式。但树莓派通常是表示为 如‘/dev/ttyUSB0’的形式。
2.首先将自己的usb插入树莓派上,然后再树莓派终端上输入查询指令 :ls /dev/ttyUSB* (ls -l /dev/tty*

); the following display after query indicates that the port is this name.
Insert image description here

3.在自己py程序中原来端口名称换成查询到的即可

Guess you like

Origin blog.csdn.net/der_power/article/details/127701397