Arduino code from Simulink model

조회 수: 5 (최근 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 CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by