Arduino read digital input always 1

4 ビュー (過去 30 日間)
mikel lasa
mikel lasa 2020 年 10 月 29 日
回答済み: mikel lasa 2020 年 11 月 5 日
Hello,
I'm trying to read a digital input in simulink and then activate the 13 led pin of my arduino MEGA via a digital output. My problem is that the input is always 1, no matter if I push the button or not. How can I solve this?
Thanks in advance and regards,

採用された回答

Aman Vyas
Aman Vyas 2020 年 11 月 2 日
Hi,
You can click the the "Deploy to hardware" button as described in the Run Model on Arduino Hardware topic.
One common error is to click the "Run" button (green triangle), which simulates the model on your host computer. The input is always 1 because they do not exist on the host computer.
Hope it helps !

その他の回答 (1 件)

mikel lasa
mikel lasa 2020 年 11 月 5 日
Ok, i will try this!
One question, monitor and tune option is used to simulate on your hardware your code while simulink is monitoring all the inputs and outputs, Im right?

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by