Change and save parameter / variable for next startup on an arduino target using simulink
3 ビュー (過去 30 日間)
古いコメントを表示
Hi guys!
I have an Arduino Mega and want to deploy my Simulink Model on this target so the Model can run on its own without a PC, Matlab etc. In my Model i want to able to change the some settings and save theses changes permanently. The thing is i dont want to save this settings just for the actual runtime but for the next start after the Arduino is shutdown / restarted. What i want to achieve is just to save some values for my model for the next startup, like in a settings menu.
If i am correct i need to change the variables / parameters in the Model workspace. A already tried using the Data Store blocks but, as expected i am loosing the values for the next Start of the Arduino. I also tried to use "Simulink.Paramter" to change the Variables in the Workspace but i did something wrong resulting in:
The 'Simulink.Parameter' class does not support code generation
So my question is: Is it possible to change and save values in my model for the next start of the arduino? And if so how?
Thanks in advance!
Denis
0 件のコメント
回答 (1 件)
Arun Kumar
2020 年 4 月 29 日
Hi Denis,
What I understood from your question is that you want to store some data during runtime and read that data during the next/subsequent runs. On mega, this can be achieved by using the onboard EEPROM:
There's no block for EEPROM read/write in the support package, but you can create your own block by following this simple guide:
Hope this helps!
Arun
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for Arduino Hardware についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!