Failure to connect Arduino to Matlab (R2019a)
5 ビュー (過去 30 日間)
古いコメントを表示
Justin Riley
2020 年 6 月 10 日
コメント済み: MathWorks MATLAB Hardware Team
2025 年 3 月 7 日
Hi everyone,
I'm struggling to connect to my Arduino using the Arduino Support Package. Some background:
- Matlab version: R2019a
- OS: Windows 10, 64-bit
- Arduino boards tried: Nano v3.2, Nano v3.1, Uno, Sparkfun Redboard, Chinese knock-off Nano (running Nano 3.1 bootloader)
With every board I've tried:
- a = arduino();
- a = arduino('COM4','Uno'); % or the respective port that the board is showing up as in the Device Manager
- a = arduino('COM4','Nano3');
The response to a = arduino(); is always: "Cannot detect Arduino hardware. Make sure Arduino hardware is properly plugged in."
The response to the other two is always: "Cannot program board Uno/Nano3 (COM4). Please make sure the board is supported adn the port and board type are correct. For more information, see Arduino Hardware Troubleshooting."
There are all boards that I can open and program within the Arduino IDE (1.8.12).
Any guidance here?
2 件のコメント
Rohan Kale
2020 年 10 月 23 日
Hi Justin,
Can you confirm if the boards that you had mentioned, are clone boards or genuine Arduino boards? If they are clone boards, the connection might be failing due to a bootloader issue, which can be confirmed by enabling the TraceOn option while constructing the arduino object by
a = arduino('COM4', 'Nano3', 'TraceOn', true)
The TraceOn options will enable the debug messages on the command window.
For a clone nano3 board, the workaround is to upload the old Atmega328 bootloader. For getting more information on that, you can contact the MathWorks Technical Support.
Hope it helps
採用された回答
Justin Riley
2020 年 10 月 23 日
2 件のコメント
Varun
2025 年 2 月 5 日
Hi Justin,
I am trying to use the servo motr with arduino UNO in matlab. With arduino package I am getting the same issue, even after updating the IDE Root its still doen't work at all.
I am thinking to use this as a serial device to move the servo through matlab, do you have any suggestion how to troubleshoot or code through the matlab.
I have tried to use serialport option in matlab, arduino communicate fine but servo motor doesn't work. However everything work will with arduino IDE
MathWorks MATLAB Hardware Team
2025 年 3 月 7 日
Hi Varun,
You can directly use the servo-related functions provided in the MATLAB Support Package for Arduino Hardware's documentation to control a servo motor with an Arduino. Please refer to the documentation here: MATLAB Arduino Servo Documentation.
This should help you get started with controlling your servo motor using MATLAB.
Thanks,
MATLAB Hardware Team
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!