What is the best way to send and recive data from arduino to raspberry pi using simulink?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kay Levinson
el 31 de Mzo. de 2020
Respondida: Ameer Hamza
el 31 de Mzo. de 2020
Hello,
I have a Raspberry Pi 4 B and an Arduino Due and I want to use the Arduino to read data from several sensors and give commands to several servo motors, all connected to the Arduino.
All the data from the sensors need to be sent to the Raspberri Pi which in turn will send new servo commands that the Arduino then needs to execute.
What is the best way to do that using simulink?
Thanks in advance,
Kay
0 comentarios
Respuesta aceptada
Ameer Hamza
el 31 de Mzo. de 2020
"Best" is a subjective term.
Probably the easiest way is to use serial communication between Arduino and raspberry pi. The advantage of this method is that Simulink provides blocks for serial communication for both boards.
Now the most robust approach I can think of is to use the Robot Operating System (ROS). On raspberry pi, run a ROS server and run an ROS node on Arduino. The disadvantage is that Simulink does not provide any support to deploy an ROS node on Arduino, and you will need to write your own S-functions to make it work with Simulink. Simulink does provide support to deploy an ROS node on raspberry pi. The main advantage of this approach is that ROS will handle the communication protocols and consistency itself. However, I would suggest going down this path only if you already a bit of knowledge about ROS and its Arduino libraries. I do have a file exchange submission on deploying a ROS node on Arduino. If you decide to use this method, that will be helpful.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Raspberry Pi Hardware 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!