How to send data from matlab to arduino by Serial?

6 visualizaciones (últimos 30 días)
Eduardo Gabriel González Blancas
Eduardo Gabriel González Blancas el 28 de Abr. de 2023
Comentada: Cris LaPierre el 29 de Abr. de 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.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 28 de Abr. de 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 comentarios
Eduardo Gabriel González Blancas
Eduardo Gabriel González Blancas el 29 de Abr. de 2023
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 el 29 de Abr. de 2023
Perhaps if you could share some of the code you have tried.
Here are some examples you can test with:

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by