Unable to configurePin() and writeDigitalPin() for setting a UART device by Arduino MATLAB Support Package

조회 수: 5 (최근 30일)
Hi everyone,
I was working on my Arduino Uno rev3 board and trying to configure it to communicate with a UART sensor. The sensor required four pins for its multiplexor on Arduino which were D4 for Select 0 (S0), D5 for S1, D6 for S2, D7 for Enable. I have tested it on Arduino IDE before and it worked fine. As I wished to acquire data from the sensor and let MATLAB R2019b handle the processing task, I used the commands in MATLAB Support Package for Arduino. The package worked perfectly fine with another sensor that I previously used.
However I encountered a problem when I tried to set D7 as OUTPUT mode and write LOW to it. The error messege 'Unable to Retrieve Data from the Hardware' continued to appear until I unplugged the sensor. I have tried several times clearing the arduino object and reconnect the hardware really hard as the user guide of the Arduino MATLAB Support Package adviced, but it did not change. The wire connection were verified to be OK since it worked fine on Arduino IDE. Did anybody encounter similar problem and how did you solve it? Many thanks!
MATLAB.png

답변 (1개)

Bhaskar Vundurthy
Bhaskar Vundurthy 2020년 1월 8일
This error might arise when the hardware is stuck while performing the I2C operation. Consider following the steps in the following link to successfully reflash the arduino server.
Alternatively, trace messages can be utilized to view the commands that are being executed on the hardware board. To view the trace messages, create the arduino object with the TraceOn parameter set as true and use sensor functions. Note that the TraceOn is not supported for read function.

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by