Communicate with Arduino that is connected through a 4-port USB hub.

4 visualizaciones (últimos 30 días)
Hi,
I used to communicate with Arduino through MATLAB by connecting it to COM5 port and using this code:
%%Connect to Arduino
Arduino= serial(sprintf('COM5');
set(Arduino, 'BaudRate',9600, 'DataBits',8,'Parity','none', 'StopBits',1);
fopen(Arduino);
fprintf('Arduino is open!\n');
pause;
However, I now need to use 4-port USB hub as I have to connect additional USB devices (e.g., keyboard, webcam) and I have no more ports available. I connect the Arduino to that USB hub with the other devices. However, if I now run the code, it gives me an error:
Error using serial/fopen (line 72)
Open failed: Cannot connect to the COM5 port. Possible reasons are another
application is connected to the port or the port does not exist.
Error in ActArduino (line 9)
fopen(Arduino);
My question is: How can I now access the Arduino from the USB hub with Matlab?
  1 comentario
Nagarjuna Manchineni
Nagarjuna Manchineni el 20 de Jul. de 2018
When Arduino is connected to the USB hub, are you able to use Arduino IDE to deploy and run a simple code? Also, can you verify whether the Arduino is available to be accessed by any other application through the Serial port (COM 5 in your case)?

Iniciar sesión para comentar.

Respuestas (0)

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!

Translated by