Problem with de argument port?
Ältere Kommentare anzeigen
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 Kommentare
Juan Israel García Celedón
am 28 Nov. 2021
Bearbeitet: Walter Roberson
am 28 Nov. 2021
Walter Roberson
am 28 Nov. 2021
Have you used
arduinosetup
Juan Israel García Celedón
am 28 Nov. 2021
Walter Roberson
am 28 Nov. 2021
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
am 29 Nov. 2021
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
am 30 Nov. 2021
Walter Roberson
am 30 Nov. 2021
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
am 30 Nov. 2021
Walter Roberson
am 30 Nov. 2021
Try using 'BaudRate' when you arduino()
Juan Israel García Celedón
am 30 Nov. 2021
Walter Roberson
am 30 Nov. 2021
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
am 30 Nov. 2021
Antworten (0)
Kategorien
Mehr zu Arduino Hardware finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
