フィルターのクリア

Repeating pattern when sending serial data in Simulink

3 ビュー (過去 30 日間)
Xabier Goñi
Xabier Goñi 2021 年 3 月 2 日
コメント済み: Xabier Goñi 2021 年 3 月 3 日
Hi,
I'm trying to send some data from Simulink to arduino through the serial port. In the image you can see the model. I'm sending the character '1', converting it to ASCII and sending it to the arduino. As it can be seen in the display block, it is sending a 49, which is the decimal equivalent of the '1' character. In the other image I checked what data is the arduino receiving and as you can see it is getting a repeiting pattern. Apart from the character 1 I want to send I do not know why it is sending those characters and repeatedly. Is there a way just to send that single '1' character once?

採用された回答

Jonas
Jonas 2021 年 3 月 2 日
If you place blocks in a Simulink model, the blocks will be executed with a certain cycle time. This means thus you are sending the message each and every time. You can send the message only once (or based on a trigger that you give) to place the blocks inside a Triggered Subsystem and then provide a trigger to send the message.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by