Arduino code from Simulink model

6 次查看(过去 30 天)
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 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by