Control sending frequency for serial communication

조회 수: 2 (최근 30일)
Nathaniel Goldfarb
Nathaniel Goldfarb 2021년 12월 5일
편집: Nathaniel Goldfarb 2021년 12월 6일
I am trying to read/write data from an arduino over serial using Simulink. I am sending two floats down (as sin waves for now) and echoing them back to valdiate my communication is working. However I seem to be having a problem with overriding the serial buffer by writting to fast.
My question is can you control the writing rate in simulink so that is only sends a messsage over xx ms or maybe only write when simulink gets a reply message?
Here is my simulink model
THis is the responce I am getting back:
One of the sine waves is very noise. I think that his has to do with the control rate. I am sending values to fast and the arduino cannot keep up.
How can I slow down the rate at which message are being send over the Serial bus? This is just a simple example, i plan on incooperating this into my controller down the line.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by