Categories
Specials
Live Chat
My status

CES www.picasion.com
CES online Store.Apk
MAUSO

GY-521, MPU-6050 Module ,mpu6050 module ,3 Axis analog gyro sensors+ 3 Axis Accelerometer Module

GY-521, MPU-6050 Module ,mpu6050 module ,3 Axis analog gyro sensors+ 3 Axis Accelerometer Module
Product Code: Sensor
Availability: In Stock
Price: USD 4.50
Qty:     - OR -   Add to Wish List
Add to Compare

MPU-6050 Accelerometer + Gyro

Navigation


Introduction

The InvenSense MPU-6050 sensor contains a MEMS accelerometer and a MEMS gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. Therefor it captures the x, y, and z channel at the same time.

The MPU-6050 is not expensive, especially given the fact that it combines both an accelerometer and a gyro.

Photo: GY-521 breakout board

Also note that Invensense has combined the MPU-6050 with a magnetometer (compass) in a single chip called MPU-9150.


Reading raw values is easy, the rest is not

Reading the raw values for the accelerometer and gyro is easy. The sleep mode has to be disabled, and then the registers for the accelerometer and gyro can be read.

But the sensor also contains a 1024 byte FIFO buffer. The sensor values can be programmed to be placed in the FIFO buffer. And the buffer can be read by the Arduino.

The FIFO buffer is used together with the interrupt signal. If the MPU-6050 places data in the FIFO buffer, it signals the Arduino with the interrupt signal so the Arduino knows that there is data in the FIFO buffer waiting to be read.

A little more complicated is the ability to control a second I2C-device.
The MPU-6050 always acts as a slave to the Arduino with the SDA and SCL pins connected to the I2C-bus.
But beside the normal I2C-bus, it has it's own I2C controller to be a master on a second (sub)-I2C-bus. It uses the pins AUX_DA and AUX_CL for that second (sub)-I2C-bus.
It can control, for example, a magnetometer. The values of the magnetometer can be passed on to the Arduino.

Things get really complex with the "DMP".
The sensor has a "Digital Motion Processor" (DMP), also called a "Digital Motion Processing Unit". This DMP can be programmed with firmware and is able to do complex calculations with the sensor values.
For this DMP, InvenSense has a discouragement policy, by not supplying enough information how to program the DMP. However, some have used reverse engineering to capture firmware.

The DMP ("Digital Motion Processor") can do fast calculations directy on the chip. This reduces the load for the microcontroller (like the Arduino). The DMP is even able to do calculations with the sensor values of another chip, for example a magnetometer connected to the second (sub)-I2C-bus.


Code

The accelerometer and gyro values are called the "raw" values. This is just as with other accelerometer and gyro sensors. A more sophisticated application is using the DMP to retrieve specific computed values from the sensor.

The example code on this page is just a simple and basic sketch to read the raw values.

For more serious use of the MPU-6050, Jeff Rowberg has done an excellent job.
See his I2C lib: http://www.i2cdevlib.com/devices/mpu6050
Or the latest code on github: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050

The FreeIMU library includes the MPU-6050 code from Jeff Rowberg.
The FreeIMU library: http://www.varesano.net/projects/hardware/FreeIMU

To start with the MPU-6050, see the page of InvenSense: http://www.invensense.com/mems/gyro/mpu6050.html

For other programs and sensors, see the Degrees Of Freedom, 6DOF, 9DOF, 10DOF, 11DOF-section in the Playground index.


Multiple sensors

The pin "AD0" selects between I2C address 0x68 and 0x69. That makes it possible to have two of these sensors in a project. Most breakout boards have a pullup or pulldown resistor to make AD0 default low or high. Connect AD0 to GND or 3.3V for the other I2C address.

When more MPU-6050 sensors are needed in a project, the I2C-bus can be extended with multiplexers. However, someone in the forum mentioned a nice trick:

Trick
Using more than two MPU-6050 sensors can be achieved by connecting each of the AD0 pins to a seperate output of the Arduino. If the number of pins is a problem, then a shift register or a port expander can be used.

The output of a 5V Arduino can not be used. In that case a voltage divider or level shifter for 3.3 volts on each of the outputs is needed. The 5V output pins can also be converted in 3.3V open collector outputs by using transistors or an open-collector driver. Pullup resistors to 3.3V should be added for a high level of 3.3V.

Suppose all AD0 lines are default high (3.3V), so every MPU-6050 is I2C address 0x69. That I2C address is however never used ! The Arduino makes one of the AD0 lines low, and uses that sensor at I2C address 0x68. After that is finished, the Arduino selects another AD0 line, and can use that sensor.
So every sensor is used at I2C address 0x68 (one by one) and 0x69 is never used.

This should make it possible to have many MPU-6050 sensors in a project. Even more than 10 sensor should be possible.
Note that requesting data from many MPU-6050 sensors is slow, because the I2C-bus is slow. A sensor with SPI interface is faster.

At this moment (15 July 2014) it is not known if this trick works for the MPU-6050.


Breakout boards

There are a number of "breakout boards" or "sensor boards" with the MPU-6050.

Sparkfun SEN-11028

http://www.sparkfun.com/products/11028
With schematic and full information. This breakout board must be used with 3.3V. There is no voltage regulator and no I2C-level shifter on the board. The pull-up resistors for the I2C-bus are 10k.

Drotek IMU 10DOF - MPU6050 + HMC5883 + MS5611

http://www.drotek.fr/shop/en/62-imu-10dof-mpu6050-hmc5883-ms5611.html
This sensor board contains three sensors. A schematic is not provided. The interrupt ('INT') of the MPU-6050 is not made available. Therefor the FIFO and the Jeff Rowberg library can not be used.

Drotek MPU-6050 Invensense

http://www.drotek.fr/shop/en/42-mpu6050-gyro-accelerometer.html
This breakout board contains a voltage regulator. It can be used with 3.3V and with 5V. A schematic is not provided.

GY-521

This sensor board has a voltage regulator. When using 3.3V to the VCC the resulting voltage (after the onboard voltage regulator) might be too low for a good working I2C bus. It is preferred to apply 5V to the VCC pin of the sensor board. The board has pull-up resistors on the I2C-bus. The value of those pull-up resistors are sometimes 10k and sometimes 2k2. The 2k2 is rather low. If it is combined with other sensor board which have also pull-up resistors, the total pull-up impedance might be too low.
This schematic is hard to find, so here is a copy: http://playground.arduino.cc/uploads/Main/MPU6050-V1-SCH.jpg

I designed this part in Fritzing, I hope you find it useful: http://fritzing.org/projects/mpu-6050-board-gy-521-acelerometro-y-giroscopio

GY-52

This sensor board has a voltage regulator. So it can be used with 3.3V and with 5V. The board was originally designed for the MPU-3050, therefor the text "MPU-3050" or "MPU-X050" is sometimes printed on the board. The pull-up resistors are sometimes 10k and sometimes 4k7. If they are 10k, two extra pull-up resistors of 10k to the 3.3V could be added (from the SDA and SCL to the 3.3V of the sensor board or the 3.3V of the Arduino).

Flyduino MPU6050 Break Out onboard 3.3V reg

http://flyduino.net/MPU6050-Break-Out-onboard-33V-reg_1
This sensor board contains a voltage regulator, so it can also be used with 5V. The pull-up resistors of the I2C-bus are 4k7. It is actually a GY-52 breakout board.

Flyduino 10DOF IMU GY-86 MPU6050+HMC5883l+MS5611

http://flyduino.net/10DOF-IMU-GY-86-MPU6050-HMC5883l-MS5611_1
A sensor board with the MPU-6050 and a magnetometer and barometer. This schematic is hard to find, so here is a copy: http://4.bp.blogspot.com/-dIgYZJIn7E/UxfwYegZwoI/AAAAAAAAo_8/szYT2_AkNvk/s1600/GY-86-Schematic.jpg. The sensor board contains a voltage regulator, so it can be used with 5V. There seems to be also a level shifter on the board for the I2C-bus. The pull-up resistors for the I2C-bus seems to be 2k2, which is rather low.

no name breakout board

In august 2012 the cheapest breakout board with the MPU-6050 was a breakout board (for about 12 dollars/ 10euros) without any name or code.
The header is on the right with the pins in this order: "5V", "3V3", "GND", "SCL", "SDA", "INT", "SYNC", "CLK", "ASCL", "ADSA".
There are two pull-up resistors for the SCL and SDA, but the value is unknown. On the back are three solder jumpers, one of them for AD0.

no name breakout board 2

In 2014 a new MPU-6050 appeared without any name or code.
http://www.i2cdevlib.com/forums/topic/8-mpu6050-connection-failed/?p=347
The header is on the left with the pins in this order: "VCC", "GND", "SCL", "SDA", "XDA", "XCL", "AD0", "INT".
It is almost equal to the GY-521 board. There is a voltage regulator on the board for 3.3V. There are two 10k pull-up resistors for the SCL and SDA, and also 330 ohm resistors in the SCL and SDA signal. Because of the voltage regulator, connect 5V to the VCC of this sensor board.

Measurements

The raw values raises questions in the forums, since the raw values might seem unstable. Below are the raw values of the sensor that I measured, so you can compare them with your own raw values.

The raw values changes a lot due to a number of reasons. The default sensitivity is high, and the sensor returnes 16 bits, but the actual valid number of bits is less than 16 bits. Since they are 16 bits, a variation of 50 is just a very small variation.

The next measurement were done in these conditions:

  • The sensor was placed as horizontal as possible.
  • It was placed on concreet, not a wooden table.
  • During the measurements, there was no traffic in the street.
  • An battery of 12V was used, not the less stable voltage from the USB bus. I used a battery instead of an adapter to avoid any mains noise.
  • The circuit was on for 15 minutes, to stabalize any temperature influence.
  • The room temperature was 25 degrees Celcius.
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 184, -484, 14992
temperature: 29.635 degrees Celsius
gyro x,y,z : 367, 220, -812, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 116, -364, 15056
temperature: 29.635 degrees Celsius
gyro x,y,z : 373, 226, -766, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 232, -432, 15100
temperature: 29.682 degrees Celsius
gyro x,y,z : 382, 232, -790, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 280, -468, 15136
temperature: 29.635 degrees Celsius
gyro x,y,z : 368, 211, -820, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 140, -432, 15108
temperature: 29.588 degrees Celsius
gyro x,y,z : 388, 203, -806, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 220, -464, 14920
temperature: 29.541 degrees Celsius
gyro x,y,z : 374, 196, -774, 

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 172, -440, 15100
temperature: 29.588 degrees Celsius
gyro x,y,z : 363, 200, -769, 

Example sketch

The sketch below is the code made with Arduino 1.0.1 and it uses I2C-bus communication.

The code uses the Arduino functions as much as possible. It is just a simple and basic sketch to get the MPU-6050 working.

The I2C-address depends on the AD0 pin of the sensor. If it is connected to ground, the address is 0x68. If it is connected to VLOGIC (+3.3V) it is 0x69. There are a few sensor boards with the MPU-6050 sensor already soldered on it. Some of those boards have a pull-down resistor at AD0 (address = 0x68), others have a pull-up resistor (address = 0x69).

Search in the sketch for "MPU6050_I2C_ADDRESS" and set that to your own I2C address.
A i2c_scanner can be used to check if the device is connected to the i2c bus.

The acceleration and gyro values of the sketch are raw values, which are not yet compensated for offset. The very first acceleration and gyro values after power up are sometimes not valid.

The sketch is about 7kbyte, and will fit in a ATmega8.

 

  1. // MPU-6050 Accelerometer + Gyro
  2. // -----------------------------
  3. //
  4. // By arduino.cc user "Krodal".
  5. //
  6. // June 2012
  7. //      first version
  8. // July 2013
  9. //      The 'int' in the union for the x,y,z
  10. //      changed into int16_t to be compatible
  11. //      with Arduino Due.
  12. //
  13. // Open Source / Public Domain
  14. //
  15. // Using Arduino 1.0.1
  16. // It will not work with an older version,
  17. // since Wire.endTransmission() uses a parameter
  18. // to hold or release the I2C bus.
  19. //
  20. // Documentation:
  21. // - The InvenSense documents:
  22. //   - "MPU-6000 and MPU-6050 Product Specification",
  23. //     PS-MPU-6000A.pdf
  24. //   - "MPU-6000 and MPU-6050 Register Map and Descriptions",
  25. //     RM-MPU-6000A.pdf or RS-MPU-6000A.pdf
  26. //   - "MPU-6000/MPU-6050 9-Axis Evaluation Board User Guide"
  27. //     AN-MPU-6000EVB.pdf
  28. //
  29. // The accuracy is 16-bits.
  30. //
  31. // Temperature sensor from -40 to +85 degrees Celsius
  32. //   340 per degrees, -512 at 35 degrees.
  33. //
  34. // At power-up, all registers are zero, except these two:
  35. //      Register 0x6B (PWR_MGMT_2) = 0x40  (I read zero).
  36. //      Register 0x75 (WHO_AM_I)   = 0x68.
  37. //
  38.  
  39. #include <Wire.h>
  40.  
  41.  
  42. // The name of the sensor is "MPU-6050".
  43. // For program code, I omit the '-',
  44. // therefor I use the name "MPU6050....".
  45.  
  46.  
  47. // Register names according to the datasheet.
  48. // According to the InvenSense document
  49. // "MPU-6000 and MPU-6050 Register Map
  50. // and Descriptions Revision 3.2", there are no registers
  51. // at 0x02 ... 0x18, but according other information
  52. // the registers in that unknown area are for gain
  53. // and offsets.
  54. //
  55. #define MPU6050_AUX_VDDIO          0x01   // R/W
  56. #define MPU6050_SMPLRT_DIV         0x19   // R/W
  57. #define MPU6050_CONFIG             0x1A   // R/W
  58. #define MPU6050_GYRO_CONFIG        0x1B   // R/W
  59. #define MPU6050_ACCEL_CONFIG       0x1C   // R/W
  60. #define MPU6050_FF_THR             0x1D   // R/W
  61. #define MPU6050_FF_DUR             0x1E   // R/W
  62. #define MPU6050_MOT_THR            0x1F   // R/W
  63. #define MPU6050_MOT_DUR            0x20   // R/W
  64. #define MPU6050_ZRMOT_THR          0x21   // R/W
  65. #define MPU6050_ZRMOT_DUR          0x22   // R/W
  66. #define MPU6050_FIFO_EN            0x23   // R/W
  67. #define MPU6050_I2C_MST_CTRL       0x24   // R/W
  68. #define MPU6050_I2C_SLV0_ADDR      0x25   // R/W
  69. #define MPU6050_I2C_SLV0_REG       0x26   // R/W
  70. #define MPU6050_I2C_SLV0_CTRL      0x27   // R/W
  71. #define MPU6050_I2C_SLV1_ADDR      0x28   // R/W
  72. #define MPU6050_I2C_SLV1_REG       0x29   // R/W
  73. #define MPU6050_I2C_SLV1_CTRL      0x2A   // R/W
  74. #define MPU6050_I2C_SLV2_ADDR      0x2B   // R/W
  75. #define MPU6050_I2C_SLV2_REG       0x2C   // R/W
  76. #define MPU6050_I2C_SLV2_CTRL      0x2D   // R/W
  77. #define MPU6050_I2C_SLV3_ADDR      0x2E   // R/W
  78. #define MPU6050_I2C_SLV3_REG       0x2F   // R/W
  79. #define MPU6050_I2C_SLV3_CTRL      0x30   // R/W
  80. #define MPU6050_I2C_SLV4_ADDR      0x31   // R/W
  81. #define MPU6050_I2C_SLV4_REG       0x32   // R/W
  82. #define MPU6050_I2C_SLV4_DO        0x33   // R/W
  83. #define MPU6050_I2C_SLV4_CTRL      0x34   // R/W
  84. #define MPU6050_I2C_SLV4_DI        0x35   // R  
  85. #define MPU6050_I2C_MST_STATUS     0x36   // R
  86. #define MPU6050_INT_PIN_CFG        0x37   // R/W
  87. #define MPU6050_INT_ENABLE         0x38   // R/W
  88. #define MPU6050_INT_STATUS         0x3A   // R  
  89. #define MPU6050_ACCEL_XOUT_H       0x3B   // R  
  90. #define MPU6050_ACCEL_XOUT_L       0x3C   // R  
  91. #define MPU6050_ACCEL_YOUT_H       0x3D   // R  
  92. #define MPU6050_ACCEL_YOUT_L       0x3E   // R  
  93. #define MPU6050_ACCEL_ZOUT_H       0x3F   // R  
  94. #define MPU6050_ACCEL_ZOUT_L       0x40   // R  
  95. #define MPU6050_TEMP_OUT_H         0x41   // R  
  96. #define MPU6050_TEMP_OUT_L         0x42   // R  
  97. #define MPU6050_GYRO_XOUT_H        0x43   // R  
  98. #define MPU6050_GYRO_XOUT_L        0x44   // R  
  99. #define MPU6050_GYRO_YOUT_H        0x45   // R  
  100. #define MPU6050_GYRO_YOUT_L        0x46   // R  
  101. #define MPU6050_GYRO_ZOUT_H        0x47   // R  
  102. #define MPU6050_GYRO_ZOUT_L        0x48   // R  
  103. #define MPU6050_EXT_SENS_DATA_00   0x49   // R  
  104. #define MPU6050_EXT_SENS_DATA_01   0x4A   // R  
  105. #define MPU6050_EXT_SENS_DATA_02   0x4B   // R  
  106. #define MPU6050_EXT_SENS_DATA_03   0x4C   // R  
  107. #define MPU6050_EXT_SENS_DATA_04   0x4D   // R  
  108. #define MPU6050_EXT_SENS_DATA_05   0x4E   // R  
  109. #define MPU6050_EXT_SENS_DATA_06   0x4F   // R  
  110. #define MPU6050_EXT_SENS_DATA_07   0x50   // R  
  111. #define MPU6050_EXT_SENS_DATA_08   0x51   // R  
  112. #define MPU6050_EXT_SENS_DATA_09   0x52   // R  
  113. #define MPU6050_EXT_SENS_DATA_10   0x53   // R  
  114. #define MPU6050_EXT_SENS_DATA_11   0x54   // R  
  115. #define MPU6050_EXT_SENS_DATA_12   0x55   // R  
  116. #define MPU6050_EXT_SENS_DATA_13   0x56   // R  
  117. #define MPU6050_EXT_SENS_DATA_14   0x57   // R  
  118. #define MPU6050_EXT_SENS_DATA_15   0x58   // R  
  119. #define MPU6050_EXT_SENS_DATA_16   0x59   // R  
  120. #define MPU6050_EXT_SENS_DATA_17   0x5A   // R  
  121. #define MPU6050_EXT_SENS_DATA_18   0x5B   // R  
  122. #define MPU6050_EXT_SENS_DATA_19   0x5C   // R  
  123. #define MPU6050_EXT_SENS_DATA_20   0x5D   // R  
  124. #define MPU6050_EXT_SENS_DATA_21   0x5E   // R  
  125. #define MPU6050_EXT_SENS_DATA_22   0x5F   // R  
  126. #define MPU6050_EXT_SENS_DATA_23   0x60   // R  
  127. #define MPU6050_MOT_DETECT_STATUS  0x61   // R  
  128. #define MPU6050_I2C_SLV0_DO        0x63   // R/W
  129. #define MPU6050_I2C_SLV1_DO        0x64   // R/W
  130. #define MPU6050_I2C_SLV2_DO        0x65   // R/W
  131. #define MPU6050_I2C_SLV3_DO        0x66   // R/W
  132. #define MPU6050_I2C_MST_DELAY_CTRL 0x67   // R/W
  133. #define MPU6050_SIGNAL_PATH_RESET  0x68   // R/W
  134. #define MPU6050_MOT_DETECT_CTRL    0x69   // R/W
  135. #define MPU6050_USER_CTRL          0x6A   // R/W
  136. #define MPU6050_PWR_MGMT_1         0x6B   // R/W
  137. #define MPU6050_PWR_MGMT_2         0x6C   // R/W
  138. #define MPU6050_FIFO_COUNTH        0x72   // R/W
  139. #define MPU6050_FIFO_COUNTL        0x73   // R/W
  140. #define MPU6050_FIFO_R_W           0x74   // R/W
  141. #define MPU6050_WHO_AM_I           0x75   // R
  142.  
  143.  
  144. // Defines for the bits, to be able to change
  145. // between bit number and binary definition.
  146. // By using the bit number, programming the sensor
  147. // is like programming the AVR microcontroller.
  148. // But instead of using "(1<<X)", or "_BV(X)",
  149. // the Arduino "bit(X)" is used.
  150. #define MPU6050_D0 0
  151. #define MPU6050_D1 1
  152. #define MPU6050_D2 2
  153. #define MPU6050_D3 3
  154. #define MPU6050_D4 4
  155. #define MPU6050_D5 5
  156. #define MPU6050_D6 6
  157. #define MPU6050_D7 7
  158.  
  159. // AUX_VDDIO Register
  160. #define MPU6050_AUX_VDDIO MPU6050_D7  // I2C high: 1=VDD, 0=VLOGIC
  161.  
  162. // CONFIG Register
  163. // DLPF is Digital Low Pass Filter for both gyro and accelerometers.
  164. // These are the names for the bits.
  165. // Use these only with the bit() macro.
  166. #define MPU6050_DLPF_CFG0     MPU6050_D0
  167. #define MPU6050_DLPF_CFG1     MPU6050_D1
  168. #define MPU6050_DLPF_CFG2     MPU6050_D2
  169. #define MPU6050_EXT_SYNC_SET0 MPU6050_D3
  170. #define MPU6050_EXT_SYNC_SET1 MPU6050_D4
  171. #define MPU6050_EXT_SYNC_SET2 MPU6050_D5
  172.  
  173. // Combined definitions for the EXT_SYNC_SET values
  174. #define MPU6050_EXT_SYNC_SET_0 (0)
  175. #define MPU6050_EXT_SYNC_SET_1 (bit(MPU6050_EXT_SYNC_SET0))
  176. #define MPU6050_EXT_SYNC_SET_2 (bit(MPU6050_EXT_SYNC_SET1))
  177. #define MPU6050_EXT_SYNC_SET_3 (bit(MPU6050_EXT_SYNC_SET1)|bit(MPU6050_EXT_SYNC_SET0))
  178. #define MPU6050_EXT_SYNC_SET_4 (bit(MPU6050_EXT_SYNC_SET2))
  179. #define MPU6050_EXT_SYNC_SET_5 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET0))
  180. #define MPU6050_EXT_SYNC_SET_6 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET1))
  181. #define MPU6050_EXT_SYNC_SET_7 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET1)|bit(MPU6050_EXT_SYNC_SET0))
  182.  
  183. // Alternative names for the combined definitions.
  184. #define MPU6050_EXT_SYNC_DISABLED     MPU6050_EXT_SYNC_SET_0
  185. #define MPU6050_EXT_SYNC_TEMP_OUT_L   MPU6050_EXT_SYNC_SET_1
  186. #define MPU6050_EXT_SYNC_GYRO_XOUT_L  MPU6050_EXT_SYNC_SET_2
  187. #define MPU6050_EXT_SYNC_GYRO_YOUT_L  MPU6050_EXT_SYNC_SET_3
  188. #define MPU6050_EXT_SYNC_GYRO_ZOUT_L  MPU6050_EXT_SYNC_SET_4
  189. #define MPU6050_EXT_SYNC_ACCEL_XOUT_L MPU6050_EXT_SYNC_SET_5
  190. #define MPU6050_EXT_SYNC_ACCEL_YOUT_L MPU6050_EXT_SYNC_SET_6
  191. #define MPU6050_EXT_SYNC_ACCEL_ZOUT_L MPU6050_EXT_SYNC_SET_7
  192.  
  193. // Combined definitions for the DLPF_CFG values
  194. #define MPU6050_DLPF_CFG_0 (0)
  195. #define MPU6050_DLPF_CFG_1 (bit(MPU6050_DLPF_CFG0))
  196. #define MPU6050_DLPF_CFG_2 (bit(MPU6050_DLPF_CFG1))
  197. #define MPU6050_DLPF_CFG_3 (bit(MPU6050_DLPF_CFG1)|bit(MPU6050_DLPF_CFG0))
  198. #define MPU6050_DLPF_CFG_4 (bit(MPU6050_DLPF_CFG2))
  199. #define MPU6050_DLPF_CFG_5 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG0))
  200. #define MPU6050_DLPF_CFG_6 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG1))
  201. #define MPU6050_DLPF_CFG_7 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG1)|bit(MPU6050_DLPF_CFG0))
  202.  
  203. // Alternative names for the combined definitions
  204. // This name uses the bandwidth (Hz) for the accelometer,
  205. // for the gyro the bandwidth is almost the same.
  206. #define MPU6050_DLPF_260HZ    MPU6050_DLPF_CFG_0
  207. #define MPU6050_DLPF_184HZ    MPU6050_DLPF_CFG_1
  208. #define MPU6050_DLPF_94HZ     MPU6050_DLPF_CFG_2
  209. #define MPU6050_DLPF_44HZ     MPU6050_DLPF_CFG_3
  210. #define MPU6050_DLPF_21HZ     MPU6050_DLPF_CFG_4
  211. #define MPU6050_DLPF_10HZ     MPU6050_DLPF_CFG_5
  212. #define MPU6050_DLPF_5HZ      MPU6050_DLPF_CFG_6
  213. #define MPU6050_DLPF_RESERVED MPU6050_DLPF_CFG_7
  214.  
  215. // GYRO_CONFIG Register
  216. // The XG_ST, YG_ST, ZG_ST are bits for selftest.
  217. // The FS_SEL sets the range for the gyro.
  218. // These are the names for the bits.
  219. &a

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



Powered By OpenCart
Cambodia Electronic Source © 2024