- Close both the Arduino IDE and MATLAB.
- Disconnect the Arduino board from your computer.
- Open the Arduino IDE and go to "Tools" > "Port" and make sure that no serial port is selected.
- Close the Arduino IDE.
- Reconnect the Arduino board to your computer.
- Open MATLAB and try running your MATLAB code that communicates with the Arduino.
Cannot use arduino and matlab together due to serial port issues
74 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi im doing a project utilising an ultrasonic sensor and attempting to send that data over to matlab in order to create an accupancy grid. To do this both matlab and the arduino IDE need to be connected to the same serial port. However, when i run the arduino first the code uploads fine, but when I attempt to run the matlab code it gives the error message that COM4 is not usable. The same thing happens when I restart my PC with and run the matlab code first, just with the arduino IDE giving the error message and not the matlab. What can I do to remedy the situation.
0 comentarios
Respuestas (1)
Priyank Pandey
el 16 de Mayo de 2023
Hi Rafey,
If you are experiencing issues with the serial port being inaccessible when both Arduino IDE and MATLAB are running, it might be due to a conflict where both programs are trying to access the same port simultaneously. To resolve this issue, you can try the following steps:
By ensuring that the Arduino IDE is not actively using the serial port before running your MATLAB code, you can avoid conflicts between the two programs. Additionally, make sure that you are using the correct serial port in your MATLAB code to establish communication with the Arduino board.
Regards
Priyank
0 comentarios
Ver también
Categorías
Más información sobre Arduino Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!