Clear Filters
Clear Filters

Reemplace S-Function Level 2 with C-MEX to read IMU sensor by I2C, Possible???

1 view (last 30 days)
Hi all;
I'm making a quadcopter controller with Simulink using the Energia add-on for TivaC embedded launchpad.
To read the inertial sensor by I2C I made a s-function block level 2, but the maximum read frequency that I can raise is 250Hz, I need at least 400 - 500 Hz. I know that is possible because I made it with C code in Energia and I could reach 750Hz.
Reading on the web I found that the S-function blocks have slow function and an option to increase the speed is to make C-mex codes, but I don't have any idea of how doing a program to read a sensor, and I'm not sure that C-mex can do that.
Do you know if it's possible?, or do you have some idea to reduce the sample time?
Thanks a lot
Regards

Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!