How can i use Arduino functions (code) in simulink?

4 ビュー (過去 30 日間)
Michael Goebel
Michael Goebel 2020 年 6 月 19 日
コメント済み: Santiago 2024 年 2 月 1 日
Hi everyone,
i would like to use arduino code like tone(pin, freq, duration) in simulink, i.e. to generate a sound with a certrain frequency using a buzzer, standalone on an arduino.
As far as i know, the playtone() function does not work in standalone mode.
How to do it best? S-function? Matlab-Function? ...?
An example simulink model would help me a lot.
  13 件のコメント
sapan agha
sapan agha 2020 年 6 月 19 日
the question say what is recaailng matrix
do you have any idea about recalling matrix
Michael Goebel
Michael Goebel 2020 年 6 月 19 日

サインインしてコメントする。

採用された回答

Michael Goebel
Michael Goebel 2020 年 6 月 25 日
That didnt really help much.
A simple example would have helped a lot.
I realized it with a s-function builder and some manual adjustments in the generated .c file ( add extern "C" to each funtion, and rename .c file to .cpp)
  1 件のコメント
Santiago
Santiago 2024 年 2 月 1 日
Hi. I have the same problem.
If I understand correctly, you created a C file with the tune() function?

サインインしてコメントする。

その他の回答 (2 件)

Michael Goebel
Michael Goebel 2020 年 6 月 22 日
*push*
anyone?

Raunak Gupta
Raunak Gupta 2020 年 6 月 24 日
Hi,
There are lot of reference about Arduino Support from MATLAB that enables to use MATLAB to interact with Arduino Board. You may install MATLAB Support Package for Arduino Hardware from Add-on explorer. Also, following link contains many resources around the same.
Similarly, there is Arduino Support from Simulink which you can use by installing Simulink Support Package for Arduino Hardware from Add-on explorer. Here you can develop and simulate the algorithms in Simulink that run standalone on Arduino. For resources to get started you may follow below mentioned link.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by