Does controlling arduino via the simulink arduino link overwrite the code on the arduino itself?

2 次查看(过去 30 天)
I want to communicate with my Arduino through the Simulink Arduino Link. I would like to accept calculated signals from the Simulink model, and process it in Arduino. Is this possible? Or does using the Arduino link in the first place overwrite any code that is currently trying to be run on the Arduino?

回答(1 个)

Aman Banthia
Aman Banthia 2023-9-12
编辑:Aman Banthia 2023-9-12
Hi Shirahn,
I understand that you have already uploaded the code to your Arduino board and then you are trying to extract data from Simulink and use it with the code in Arduino.
Assuming that you are using the Simulink Arduino Support Package to communicate with an Arduino board, you can indeed accept calculated signals from the Simulink model and process them on the Arduino. The Simulink Arduino Support Package allows you to generate code from your Simulink model and deploy it onto the Arduino board, enabling bidirectional communication between Simulink and Arduino.
Here is how it typically works:
  1. You develop your Simulink model, which includes the calculations or signal processing algorithms you want to implement.
  2. Using the Simulink Arduino Support Package, you generate code from your Simulink model. This code is specific to your application and can include both the calculations performed in Simulink and any additional code you want to run on the Arduino.
  3. The generated code is uploaded to the Arduino board using the Arduino IDE or directly from Simulink.
  4. Once the code is running on the Arduino, it can receive inputs from Simulink, process them using your specified calculations or algorithms, and perform any additional actions or outputs as needed.
Please refer to the following MathWorks File Exchange package to know more about the Simulink Support package for Arduino:
Please refer to the following MATLAB documentation for the Arduino Support Package for Simulink:
Hope the above details help you.
Best Regards,
Aman Banthia

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by