I am using MATLAB 2020b, and my late 2018 macbook air is running on macOS Big ßur 11.1.
When I input serialportlist("available") in the command window to see if the port I need is available, it is not there -- it just shows a couple bluetooth ports.
My intended setup is as follows:
1) Arduino prints something in its serial monitor.
2) Arduino is connected to my macbook via USB cable.
2) Then I want MATLAB to read the output in the serial monitor through serialport function (e.g., readline).
(The output will be always the same -- some simple text serving as a signal for matlab.)
What should I do to make MATLAB recognize the USB connection from arduino?
Relevant part of my code is shown below:
arduinoObj = serialport("/dev/cu.usbmodem141201", 115200);
configureTerminator(arduinoObj, "LF");
Error message:
Error using serialport (line 116)
Unable to connect to the serialport device at port '/dev/cu.usbmodem141201'. 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.
Error in DriftingGrating (line 65)
arduinoObj = serialport("/dev/cu.usbmodem141201", 115200);