Arduino Simulink Analog input

25 Ansichten (letzte 30 Tage)
anil
anil am 3 Feb. 2014
Kommentiert: Quang Huy am 10 Jan. 2021
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...

Antworten (3)

Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer am 7 Feb. 2014
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 Kommentare
Terry Ramsey
Terry Ramsey am 16 Feb. 2014
Bearbeitet: Terry Ramsey am 16 Feb. 2014
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 am 28 Mai 2014
Bearbeitet: anil am 28 Mai 2014
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.

Melden Sie sich an, um zu kommentieren.


zeghib okba
zeghib okba am 10 Mai 2016
Bearbeitet: zeghib okba am 10 Mai 2016
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 am 29 Jan. 2018
I had the same problem with arduino uno and I fixed it, just change the mode to external: simulation->mode-> external.
  1 Kommentar
Quang Huy
Quang Huy am 10 Jan. 2021
I had the same problem with arduino uno. I tried it the way you do but not sucessfull.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by