where to set the offset code of the MPU in S-function builder ?

2 ビュー (過去 30 日間)
toussi ayadi
toussi ayadi 2018 年 9 月 10 日
i downloaded a ready S-function of MPU 6050 from this link: https://minseg.webs.com/arduino-downloads and i'm using a trial version R2018a. in the s-function, there's a part of libraries part of Update pane
Wire.begin();
accelgyro.initialize();
part of output pane
x_vel[0]=accelgyro.getRotationX();
y_vel[0]=accelgyro.getRotationY();
z_vel[0]=accelgyro.getRotationZ();
x_acc[0]=accelgyro.getAccelerationX();
y_acc[0]=accelgyro.getAccelerationY();
z_acc[0]=accelgyro.getAccelerationZ();
i wanted to add setoffset() because my MPU give me wrong values
accelgyro.setXAccelOffset(-917);
accelgyro.setYAccelOffset(-1479);
accelgyro.setZAccelOffset(1380);
accelgyro.setXGyroOffset(-2944);
accelgyro.setYGyroOffset(-18);
accelgyro.setZGyroOffset(-6);
i put it in different panes start, output and update but it still give me wrong values. i didn't know what to do.

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by