How to send data from matlab to arduino by Serial?

6 vues (au cours des 30 derniers jours)
Eduardo Gabriel González Blancas
Commenté : Cris LaPierre le 29 Avr 2023
Hi guys, How can I send data from matlab to arduino? I'm trying to send 3 values to arduino using serial port, I used fprintf() but the value in arduino doesn't change as if it had never been sent it, because when I read the 3 variables in Matlab they have the same initial value, and the Read Led turns on.

Réponses (1)

Cris LaPierre
Cris LaPierre le 28 Avr 2023
It looks like you are using an older syntax. See this page:
You will want to connect using serialport and can write using write or writeline. See here:
  2 commentaires
Eduardo Gabriel González Blancas
I tried that syntax but it still doesn't work, so I tried to send the same data from Aruino IDE monitor serie and it works, so I don't why with Matlab, arduino doesn't get the data.
Cris LaPierre
Cris LaPierre le 29 Avr 2023
Perhaps if you could share some of the code you have tried.
Here are some examples you can test with:

Connectez-vous pour commenter.

Catégories

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

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by