Arduino Simulink Analog input

I AM USING A AUDRINO ANALOG INPUT PIN TO DISPLAY A VOLTAGE. WHEN I RUN THE MODEL ON TARGETED HARDWARE I ENDED UP GETTING ZERO. CAN ANY ONE HELP ME...

回答 (3 件)

Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer 2014 年 2 月 7 日

0 投票

Hi Anil, It sounds like you clicked the Run (green triangle) button, which simulates the model on your host computer. Try clicking the Deploy to Hardware button instead. See http://www.mathworks.com/help/simulink/ug/run-model-on-arduino-hardware.html

4 件のコメント

anil
anil 2014 年 2 月 8 日
HI Rolfe Dlugy-Hegwer, thank you for your response. i actually run the model on the targeted hardware. and now i also tried the deploy option, i am getting the same response. endedup getting zero. My Arduino board not even transmitting the data to the lap. i checked the same circuit in the arduino software. i am getting the output on the serial monitor and as you know transmitting led is glowing. this is what i am doing i take the analog input block with the analog pin 4 and connecting it to the display and scope then i prepare to run the model then i run the model using run button or deploy button. then simulink says model successfully downloaded into arduino uno board but my display block showing me zero.
Terry Ramsey
Terry Ramsey 2014 年 2 月 16 日
I'm having exact same problem. Any input would be greatly appreciated.
Terry Ramsey
Terry Ramsey 2014 年 2 月 16 日
編集済み: Terry Ramsey 2014 年 2 月 16 日
my blocks being used are: Analog Input (pin 0). I have pin 0 on arduino connected to an analog input(a potentiometer with 0-5V in this case). Sample time = 0.5. A Display block. Short format. Decimation = 1. They are connected together.
Not sure why this isnt working.
anil
anil 2014 年 5 月 28 日
編集済み: anil 2014 年 5 月 28 日
HI Terry Ramsey, the external mode isn't work on the arduino uno. it will run on the arduino mega. they say uno doesn't have enough memory to perform in external mode.
i got this from matlab virtual seminor.

サインインしてコメントする。

zeghib okba
zeghib okba 2016 年 5 月 10 日
編集済み: zeghib okba 2016 年 5 月 10 日

0 投票

Hi Anil, the problem may be doing from 2 things:
1- you should be using arduino mega2560 for display a voltage.
2- You may be inverted the signal, because arduino is not accepted negative signal.
Tal Dachlika
Tal Dachlika 2018 年 1 月 29 日

0 投票

I had the same problem with arduino uno and I fixed it, just change the mode to external: simulation->mode-> external.

1 件のコメント

Quang Huy
Quang Huy 2021 年 1 月 10 日
I had the same problem with arduino uno. I tried it the way you do but not sucessfull.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeArduino Hardware についてさらに検索

質問済み:

2014 年 2 月 3 日

コメント済み:

2021 年 1 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by