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

1 Ansicht (letzte 30 Tage)
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

Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by