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!
