how I can get 2 mpu6050 data from arduino to matlab!

10 ビュー (過去 30 日間)
reut
reut 2014 年 5 月 14 日
コメント済み: Gayatri Menon 2020 年 10 月 23 日
hi!! I'm using 2 mpu6050 that connected in parallel to my arduino. I need to get the data, analysis it ,and make graph with this data. how to do it?!?!?
thanks:) Reut

回答 (2 件)

Zafb
Zafb 2014 年 9 月 18 日
Hi, I am trying the same with no success so far. However, for plotting, I have used the PLX-Daq quite successfully. http://gadgetmakersblog.com/top-5-arduino-tools/
Regards,

Gayatri Menon
Gayatri Menon 2020 年 1 月 31 日
Hi,
From R2019a, to read the data from mpu6050 connected to arduino, the below code can be used:
Please refer the below link for more information:
a = arduino
imu = mpu6050(a);
accel = readAcceleration(imu);
gyro = readAngularVelocity(imu);
For connecting two mpu6050, you need to have different I2C address for each device.This can be done by connecting AD0 pin of one of the sensor to logic level HIGH(0x68 is the default address, if AD0 is high, the address will be 0x69).Then you can specify the addresws of I2C device using a Name value pair.
imu1 = mpu6050(a,'I2CAddress','0x68')
imu2 = mpu6050(a,'I2CAddress','0x69')
Hope this helps,
Thanks
Gayatri
  2 件のコメント
haziqah zaifuddin
haziqah zaifuddin 2020 年 10 月 22 日
hi, is this code will directly provide acceleration value? because intially the data pruduced by mpu6050 is in (g) unit
Gayatri Menon
Gayatri Menon 2020 年 10 月 23 日
Acceleration values outputted by the object function readAcceleration is in m/s^2

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

カテゴリ

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