Arduino code from Simulink model

6 ビュー (過去 30 日間)
Muhammad Imran Chughtai
Muhammad Imran Chughtai 2022 年 5 月 24 日
回答済み: 裕之 2024 年 2 月 19 日
I am trying to use "Embedded Coder Target for Arduino" from Simulink to get Arduino code for my model. Tried following the pdf document that comes with the add-on but still get the following errors:
Error using arduino_ec.Prefs.setBoard (line 75) Unable to find board specification file. Ensure that the path to the Arduino IDE is set correctly, e.g. arduino_ec.Prefs.setArduinoPath('c:arduino-1.0.5')
Error in setup_customtarget_arduino (line 34) arduino_ec.Prefs.setBoard('mega2560'); % Choose a specific board name
Please note I am beginner level in this. All I want is to convert my Simulink model to Arduino code, currently using Mega2560

回答 (2 件)

Bilal Ozcan
Bilal Ozcan 2022 年 10 月 25 日
Hello All,
I have the same problem. If you have any information, please write it down.
Sincerely,
Bilal

裕之
裕之 2024 年 2 月 19 日
1.Boards.txtファイルはArduinoIDEの下にはない。
Windowsはここにあった。
C:\Users\****\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
PCによって場所は違うかもしれない。
Arduino15というフォルダを探してみてください。
2.Boards.txtArduinoIDEをインストールしたフォルダにコピーする。
3.C:\*******\arduino_ec_target\arduino_ec\+arduino_ecフォルダにあるPrefs.mを修正する。
71行目をboardsFileの値がBoards.txtの置き場所となるように修正する。
boardsFile = fullfile(arduino_ec.Prefs.getArduinoPath(), 'hardware', 'arduino', 'boards.txt');
'hardware', 'arduino'を削除すればよいと思う。
これでsetup_customtarget_arduino.mが正常終了した。

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by