- 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
125 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Priyank Pandey
il 16 Mag 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 Commenti
Vedere anche
Categorie
Scopri di più su MATLAB Support Package for Arduino Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!