having problem reading data from arduino using instrument toolbox
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
ErfanH
el 11 de Oct. de 2018
Comentada: ErfanH
el 27 de Mayo de 2019
Hey there well i'm trying to send a constant like 5 to arduino using simulink " to instrument " block and in arduino i have generated a model using "serial recieve" and a "gain" plus a "serial transmit" block and in my laptop i have the "query instrument" block but the thing i get is very weird .
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197584/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197585/image.jpeg)
3 comentarios
Respuesta aceptada
Thomas Jacob
el 25 de Mayo de 2019
I hope that you might have figured out by now. In case you haven't, try this:
The problem here is due to the fact that Arduino is sending the ASCII code and Query Instument is reading the binary values. You can change this at the Query block. Double click to open Block Parameters. Under the Query tab, set the data format as ASCII. You may also the set the ASCII format string as '%d', '%f', or '%s' based on the type of data you are sending.
3 comentarios
Walter Roberson
el 26 de Mayo de 2019
To confirm, you are trying to send to more than 4 arduino simultaneously in one model ?
Más respuestas (0)
Ver también
Categorías
Más información sobre Instrument Control Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!