- 'serialportlist' function- https://www.mathworks.com/help/matlab/ref/serialportlist.html
- Resolve serial port connection error - https://www.mathworks.com/help/matlab/import_export/resolve-serial-port-connection-errors.html
How to connect a BBC micro-bit to MatLab 2023b
4 次查看(过去 30 天)
显示 更早的评论
I am a beginner Matlab user and am trying to connect a BBC microbit to my MatLab script on a Mac. I have identified the name of the port for the microbit and have added this to my script. I run into a probelm when running the script as the error message produced says that it is unable to connect to the serial port device. It suggested that the port may be in use. I believe this to be the issue as this port is not listed when I run the serialportlist("available") function. Could someone advise on how I can make this port available for use or what else may be causing this issue. Thank you!
Error message as follows:
"Error using serialport
Unable to connect to the serialport device at port '/dev/tty.usbmodem1102'. Verify that a device is connected to the port, the port is not in use,
and all serialport input arguments and parameter values are supported by the device.
See related documentation for troubleshooting steps."
0 个评论
回答(1 个)
Raj
2024-4-17
Hello @Beibhinn
I understand you are facing error while connecting BBC microbit to MATLAB. While connecting a serial device it is recommended to connect to a serial port which is available and free to use. If an attempt is made to connect a serial device to a port already in use by other application, MATLAB will throw an error.
MATLAB function 'serialportlist' returns a list of all serial ports on a system. This function can be used to get list of all available ports and you can connect the microbit to the same available port.
For better understanding refer to the documentation links below-
You can also refer the following moving ahead with your work with BBC microbit and MATLAB-
I hope this resolves your query and you are able to proceed further!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!