简体   繁体   中英

MPU6050 Read Accel,Gyro AND Magnetometer?

I have an Arduino and the MPU6050 Board. I need a sketch to read the Sensorvalues of Accel, Gyro and Compass/Magnetometer.

The Problem is: The Accel and Gyro sensor are on the same chip and the Magnetometer on a second chip.

I found only sketches for reading out gyro and accel or only magnetometer/compass

but i need something to read out all tree sensors.

help?

Ok, you'll need to provide more detail. Not sure what board you have, however:

  1. Check out Jeff Rowberg's excellent library for the MPU6050 and explanation how to read each sensor - gyroscope, accelerometer and magnetometer.
  2. If you're using one of the 9DOF/ 10DOF boards with MPU6050 eg gy-86 you'll need to disable the I2C Master Mode and Sleep Mode, and enable I2C Bypass Mode:

mpu.setI2CMasterModeEnabled(false); mpu.setI2CBypassEnabled(true); mpu.setSleepEnabled(false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM