Need help receiving accelerometer data through an I2C connection in MATLAB.

3 ビュー (過去 30 日間)
Davis Nossaman
Davis Nossaman 2017 年 6 月 29 日
I'm using a Sparkfun LSM9DS1 IMU, and an Arduino Uno. I've set up the arduino connection on MATLAB and have wired the IMU to be compatible for I2C, but am a little lost about how to get the data from this particular IMU off the Arduino and into MATLAB.

回答 (1 件)

Swarooph
Swarooph 2017 年 6 月 29 日
Have you looked at this example? It shows how to use the MATLAB Support Package for Arduino Hardware and the I2C interface to communicate with I2C devices. Note that it uses the TMP102 temperature sensor. But I think once you have the IMU wired correctly, the overall process should look the same.
  3 件のコメント
Davis Nossaman
Davis Nossaman 2017 年 6 月 29 日
The example you sent me has a 2017a tag at the top. I am using MATLAB 2014b. Might that make a difference?
TAMALAMPUDI VENKATA SAI SAKETH REDDY
TAMALAMPUDI VENKATA SAI SAKETH REDDY 2019 年 3 月 20 日
sir, The above mentioned 5 lines code was not executing.It was showing"Failed to read 2 uint8 value(s) from the device.can please give the executable code or solution for that.
Thanking you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by