How to Flash .m file to Raspberry Pi (making it standalone system) using matlab support package for RPi
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Madhu Govindarajan
2015-10-5
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for Raspberry Pi Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!