trying to connect to arduino but dissapears from serialport​list("avai​lable")

조회 수: 5 (최근 30일)
Martin Todd
Martin Todd 2024년 8월 15일
편집: akshatsood 2024년 8월 20일
Sorry if this is me being ridiculous but it's driving me up the wall!!
Trying to replicate a device using an arduino. All set up and the device once plugged in comes up as 'available'. I then try to connect and nada! I list the available ports again and it has dissapeared!
Any help??
>> serialportlist("available")
ans =
"COM3"
>> serialportlist("available")
ans =
1×0 empty string array
>> delete(instrfind({'Port'},{'COM3'}));
Warning: instrfind will be removed in a future release. There is no simple replacement for this.
>> serialportlist("available")
ans =
1×0 empty string array

답변 (1개)

akshatsood
akshatsood 2024년 8월 20일
편집: akshatsood 2024년 8월 20일
I understand that you are encountering issues with arduino disconnecting or not being recognized properly by MATLAB after an initial connection attempt.. Here are a few suggestions to help troubleshoot and resolve the issue:
Check Physical Connections:
  • Ensure the USB cable is securely connected to both the Arduino and the device.
  • Try using a different USB cable or port if possible.
Check Device Manager (Windows) or System Information (Mac):
  • On Windows, open Device Manager and look for the "Ports (COM & LPT)" section. Check if your Arduino appears there and if any warning icons are displayed.
  • On Mac, open System Information and check under "USB" to see if the Arduino is listed.
  • If the device appears with a warning or not at all, it might be a driver issue.
Use serialport in MATLAB:
  • Since "instrfind" is deprecated, consider using the "serialport" function for managing serial connections.
% Create a serial port object
s = serialport("COM3", 9600); % Replace 9600 with your baud rate
I hope this helps.

카테고리

Help CenterFile Exchange에서 Serial and USB Communication에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by