Problem with de argument port?
显示 更早的评论
Encounter this error when i tried to connect my arduino board with my matlab: Unable to create a communication link with the serial port. Please check the input argument PORT and verify that a device is connected.
Can anyone solve this?
13 个评论
Juan Israel García Celedón
2021-11-28
编辑:Walter Roberson
2021-11-28
Walter Roberson
2021-11-28
Have you used
arduinosetup
Juan Israel García Celedón
2021-11-28
Walter Roberson
2021-11-28
Which port did arduinosetup identify for use with your installed device? Have you tried hardcoding that port name in the arduino() call ?
Also, are you using Windows, or are you using Mac or Linux ?
Juan Israel García Celedón
2021-11-29
If arduinosetup was able to communicate with the port, but MATLAB is not able to communicate, then I do not know what is going on -- other than the possibility that the port is already in use ?
freeports = serialportlist("available")
Juan Israel García Celedón
2021-11-30
Walter Roberson
2021-11-30
Sorry, the only other possibility is that coming to mind is the possibility of mismatch on baud rate, if the arduino has somehow been configured to an unusual rate... but then I would expect problems with the configuration process.
Juan Israel García Celedón
2021-11-30
Walter Roberson
2021-11-30
Try using 'BaudRate' when you arduino()
Juan Israel García Celedón
2021-11-30
Walter Roberson
2021-11-30
a = arduino('COM4', 'Mega2560', 'BaudRate', 38400);
or whatever baud rate you had set the arduino to. Try 9600, 38400, 19200
Juan Israel García Celedón
2021-11-30
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
