Effacer les filtres
Effacer les filtres

Control sending frequency for serial communication

2 vues (au cours des 30 derniers jours)
Nathaniel Goldfarb
Nathaniel Goldfarb le 5 Déc 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.

Réponses (0)

Catégories

En savoir plus sur MATLAB Support Package for Arduino Hardware dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by