Arduino Connection Issue with addon

조회 수: 9 (최근 30일)
Jordan Conte
Jordan Conte 2021년 1월 23일
답변: Saurav Chaudhary 2021년 1월 27일
I am currently using an arduino with the motorshield v2 to drive a few stepper motors for my 3d printer. when I boot up matlab, I usually start by programming the arduino which completes successfully, I test the connection which also is successful. however, when I run my code I get this error message and cant figure out what could be causing it. I have tried redownloading the arduino addon, and clearing the object in the workspace but cant figure it out. sometimes it will persist for hours before I can get my code to run. I am even able to program successfully using the Arduino IDE, meaning i dont believe it is hardware related. Ive atatched screenshots
hoping someone can help!

답변 (1개)

Saurav Chaudhary
Saurav Chaudhary 2021년 1월 27일
Refer the following documentation link which states how you can perform troubleshooting steps when you get the error "Unable to receive data from the target hardware".
If you continue to face the issue with IMU sensors, it is likely that it is due to the loose connections between the sensor and Arduino board. This causes the code to get stuck while performing the I2C operation.
Also, Trace messages can be used to view the commands which are being executed on the hardware board when you are using sensor functions. To view the trace messages, create the arduino object with the TraceOn parameter set as true and use sensor functions.

카테고리

Help CenterFile Exchange에서 Embedded Coder Supported Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by