Read MMA8542 accelerometer i2c in Matlab using Raspberry pi

1 回表示 (過去 30 日間)
Ghada Alsayed
Ghada Alsayed 2020 年 3 月 3 日
Hello!
I need help please, I try to read the position [x,y,z ] in matlab, here is my code,
mypi = raspi;
scanI2CBus(mypi,'i2c-1');
myi2c = i2cdev(mypi,'i2c-1','0x1D');
output-1 = read(myi2c, 8)
In my code I have this result
0 13 248 84 252 254 64 0
My problem here is all value will be the same even if I change the location of the sensor. How I can get the position [x,y,z] , my sensor is MMA8542q
Thank you!

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB 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!

Translated by