Control sending frequency for serial communication

1 visualización (últimos 30 días)
Nathaniel Goldfarb
Nathaniel Goldfarb el 5 de Dic. de 2021
Editada: Nathaniel Goldfarb el 6 de Dic. de 2021
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.

Respuestas (0)

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by