フィルターのクリア

Simulink arduino library missing analog input as digital output block

6 ビュー (過去 30 日間)
aurochs
aurochs 2020 年 1 月 6 日
回答済み: Bhaskar Vundurthy 2020 年 1 月 9 日
Hi,
I need to use Arduino analog input pins A2 and A3 as digital output, which is possible in Uno (https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/). This is so that I could accommodate the MCP4725 DAC breakout board https://learn.sparkfun.com/tutorials/mcp4725-digital-to-analog-converter-hookup-guide. However, the Simulink Arduino library only has digital output block for digital pins. Please advise. Thanks.

採用された回答

Bhaskar Vundurthy
Bhaskar Vundurthy 2020 年 1 月 9 日
As of 2019b, the digital output block can only handle the digital output pins (D0-D13). Any value greater than 13, representing A0-A5, throws an error during build.
The analog pins A0-A5 are however accessible via MATLAB.
a = arduino();
writeDigitalPin(a, 'A0', 1);

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by