How to Flash .m file to Raspberry Pi (making it standalone system) using matlab support package for RPi
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am developing a serial echo program on the Raspberry pi (RPi) hardware i.e RPi is connected to an external microcontroller over the serial line (RX TX crossed), The external controller sends a byte of data that is received by RPi and re-transmitted back (like an echo).
I am using the matlab support package for RPi to do the same. Currently, I have written a .m file script to use the built in serial functions read() and write() to implement the requirement.
mypi = raspi()
myserialdevice = serialdev(mypi,'/dev/ttyAMA0',9600,8,'none',1)
myserialdevice.Timeout = 1000
serialdata = read(myserialdevice,1);
write(myserialdevice,serialdata,'uint8');
The RPi is connected to MATLAB via an ethernet cable, I want to run the RPi as a standalone system not connected to the PC (MATLAB). How can I burn the .m file to the target device(RPi) ? Do i need to convert to a simulink model ?
0 comentarios
Respuestas (1)
Madhu Govindarajan
el 5 de Oct. de 2015
For standalone applications, the easiest way is to use Simulink support package and put your MATLAB function inside a MATLAB function block. Although I am not sure if the serialdev, read and write command is going to work there (just that I have never tried it).
0 comentarios
Ver también
Categorías
Más información sobre MATLAB Support Package for Raspberry Pi Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!