Adafruit MPU6050 Sensor Library
Classes | Macros | Typedefs | Enumerations
Adafruit_MPU6050.h File Reference
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

class  Adafruit_MPU6050_Temp
 
class  Adafruit_MPU6050_Accelerometer
 
class  Adafruit_MPU6050_Gyro
 
class  Adafruit_MPU6050
 Class that stores state and functions for interacting with the MPU6050 I2C Digital Potentiometer. More...
 

Macros

#define MPU6050_I2CADDR_DEFAULT   0x68
 MPU6050 default i2c address w/ AD0 high.
 
#define MPU6050_DEVICE_ID   0x68
 The correct MPU6050_WHO_AM_I value.
 
#define MPU6050_SELF_TEST_X   0x0D
 Self test factory calibrated values register.
 
#define MPU6050_SELF_TEST_Y   0x0E
 Self test factory calibrated values register.
 
#define MPU6050_SELF_TEST_Z   0x0F
 Self test factory calibrated values register.
 
#define MPU6050_SELF_TEST_A   0x10
 Self test factory calibrated values register.
 
#define MPU6050_SMPLRT_DIV   0x19
 sample rate divisor register
 
#define MPU6050_CONFIG   0x1A
 General configuration register.
 
#define MPU6050_GYRO_CONFIG   0x1B
 Gyro specfic configuration register.
 
#define MPU6050_ACCEL_CONFIG   0x1C
 Accelerometer specific configration register.
 
#define MPU6050_INT_PIN_CONFIG   0x37
 Interrupt pin configuration register.
 
#define MPU6050_INT_ENABLE   0x38
 Interrupt enable configuration register.
 
#define MPU6050_INT_STATUS   0x3A
 Interrupt status register.
 
#define MPU6050_WHO_AM_I   0x75
 Divice ID register.
 
#define MPU6050_SIGNAL_PATH_RESET   0x68
 Signal path reset register.
 
#define MPU6050_USER_CTRL   0x6A
 FIFO and I2C Master control register.
 
#define MPU6050_PWR_MGMT_1   0x6B
 Primary power/sleep control register.
 
#define MPU6050_PWR_MGMT_2   0x6C
 Secondary power/sleep control register.
 
#define MPU6050_TEMP_H   0x41
 Temperature data high byte register.
 
#define MPU6050_TEMP_L   0x42
 Temperature data low byte register.
 
#define MPU6050_ACCEL_OUT   0x3B
 base address for sensor data reads
 
#define MPU6050_MOT_THR   0x1F
 Motion detection threshold bits [7:0].
 
#define MPU6050_MOT_DUR   0x20
 Duration counter threshold for motion int. 1 kHz rate, LSB = 1 ms.
 

Typedefs

typedef enum fsync_out mpu6050_fsync_out_t
 FSYNC output values. More...
 
typedef enum clock_select mpu6050_clock_select_t
 Clock source options. More...
 

Enumerations

enum  fsync_out {
  MPU6050_FSYNC_OUT_DISABLED, MPU6050_FSYNC_OUT_TEMP, MPU6050_FSYNC_OUT_GYROX, MPU6050_FSYNC_OUT_GYROY,
  MPU6050_FSYNC_OUT_GYROZ, MPU6050_FSYNC_OUT_ACCELX, MPU6050_FSYNC_OUT_ACCELY, MPU6050_FSYNC_OUT_ACCEL_Z
}
 FSYNC output values. More...
 
enum  clock_select {
  MPU6050_INTR_8MHz, MPU6050_PLL_GYROX, MPU6050_PLL_GYROY, MPU6050_PLL_GYROZ,
  MPU6050_PLL_EXT_32K, MPU6050_PLL_EXT_19MHz, MPU6050_STOP = 7
}
 Clock source options. More...
 
enum  mpu6050_accel_range_t { MPU6050_RANGE_2_G = 0b00, MPU6050_RANGE_4_G = 0b01, MPU6050_RANGE_8_G = 0b10, MPU6050_RANGE_16_G = 0b11 }
 Accelerometer range options. More...
 
enum  mpu6050_gyro_range_t { MPU6050_RANGE_250_DEG, MPU6050_RANGE_500_DEG, MPU6050_RANGE_1000_DEG, MPU6050_RANGE_2000_DEG }
 Gyroscope range options. More...
 
enum  mpu6050_bandwidth_t {
  MPU6050_BAND_260_HZ, MPU6050_BAND_184_HZ, MPU6050_BAND_94_HZ, MPU6050_BAND_44_HZ,
  MPU6050_BAND_21_HZ, MPU6050_BAND_10_HZ, MPU6050_BAND_5_HZ
}
 Digital low pass filter bandthwidth options. More...
 
enum  mpu6050_highpass_t {
  MPU6050_HIGHPASS_DISABLE, MPU6050_HIGHPASS_5_HZ, MPU6050_HIGHPASS_2_5_HZ, MPU6050_HIGHPASS_1_25_HZ,
  MPU6050_HIGHPASS_0_63_HZ, MPU6050_HIGHPASS_UNUSED, MPU6050_HIGHPASS_HOLD
}
 Accelerometer high pass filter options. More...
 
enum  mpu6050_cycle_rate_t { MPU6050_CYCLE_1_25_HZ, MPU6050_CYCLE_5_HZ, MPU6050_CYCLE_20_HZ, MPU6050_CYCLE_40_HZ }
 Periodic measurement options. More...
 

Detailed Description

I2C Driver for MPU6050 6-DoF Accelerometer and Gyro

This is a library for the Adafruit MPU6050 breakout: https://www.adafruit.com/products/3886

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

BSD license (see license.txt)

Typedef Documentation

◆ mpu6050_fsync_out_t

FSYNC output values.

Allowed values for setFsyncSampleOutput.

◆ mpu6050_clock_select_t

Clock source options.

Allowed values for setClock.

Enumeration Type Documentation

◆ fsync_out

enum fsync_out

FSYNC output values.

Allowed values for setFsyncSampleOutput.

◆ clock_select

Clock source options.

Allowed values for setClock.

◆ mpu6050_accel_range_t

Accelerometer range options.

Allowed values for setAccelerometerRange.

Enumerator
MPU6050_RANGE_2_G 

+/- 2g (default value)

MPU6050_RANGE_4_G 

+/- 4g

MPU6050_RANGE_8_G 

+/- 8g

MPU6050_RANGE_16_G 

+/- 16g

◆ mpu6050_gyro_range_t

Gyroscope range options.

Allowed values for setGyroRange.

Enumerator
MPU6050_RANGE_250_DEG 

+/- 250 deg/s (default value)

MPU6050_RANGE_500_DEG 

+/- 500 deg/s

MPU6050_RANGE_1000_DEG 

+/- 1000 deg/s

MPU6050_RANGE_2000_DEG 

+/- 2000 deg/s

◆ mpu6050_bandwidth_t

Digital low pass filter bandthwidth options.

Allowed values for setFilterBandwidth.

Enumerator
MPU6050_BAND_260_HZ 

Docs imply this disables the filter.

MPU6050_BAND_184_HZ 

184 Hz

MPU6050_BAND_94_HZ 

94 Hz

MPU6050_BAND_44_HZ 

44 Hz

MPU6050_BAND_21_HZ 

21 Hz

MPU6050_BAND_10_HZ 

10 Hz

MPU6050_BAND_5_HZ 

5 Hz

◆ mpu6050_highpass_t

Accelerometer high pass filter options.

Allowed values for setHighPassFilter.

◆ mpu6050_cycle_rate_t

Periodic measurement options.

Allowed values for setCycleRate.

Enumerator
MPU6050_CYCLE_1_25_HZ 

1.25 Hz

MPU6050_CYCLE_5_HZ 

5 Hz

MPU6050_CYCLE_20_HZ 

20 Hz

MPU6050_CYCLE_40_HZ 

40 Hz