By Esther Ling, Edu Engineer.
A driver block written using the S-Function builder to stream accelerometer and gyro values from the IMU MPU9150 into Simulink. Connect the IMU to an Arduino Mega and run in external mode.
Complements the blog post:
Techsource Technical Team (2021). Arduino MPU9150 Driver (https://www.mathworks.com/matlabcentral/fileexchange/58221-arduino-mpu9150-driver), MATLAB Central File Exchange. Retrieved .
Hello I'm inspired with your code; I'm working with arduino UNO and seed studio canbus shield (SPI communication). I done the acquisition with succes in matlab but I want to do it in simulink and I don't knew if the code you provide here will be useful.
I tryed to use Serial receive block to communicate with the Arduino and the SPI block to communicate both arduino end the sheild but it doesn't work .
So what I want to knew is that :
when we communicate an arduino in simulink, we should to do an sFunction and programm all the necessar libraries to do the acquisition?
Or we have juste to programm the arduino in arduino IDE and then use tour programm to do generate the C file in simmulink ????
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!