MPU9150

Driver for MPU9250 I2C accelerometer/gyroscope/magnetometer.

Public Types

Type

Name

enum

enum

Public Attributes

Type

Name

float

float

float

float

float

float

float

float

float

float

Protected Attributes

Type

Name

Ascale

Gscale

const float

const float

Public Functions

Type

Name

int

int

void

void

Protected Functions

Type

Name

void

Public Types Documentation

enum Ascale

enum MPU9150::Ascale {
    AFS_2G = 0,
    AFS_4G,
    AFS_8G,
    AFS_16G,
};

enum Gscale

enum MPU9150::Gscale {
    GFS_250DPS = 0,
    GFS_500DPS,
    GFS_1000DPS,
    GFS_2000DPS,
};

Public Attributes Documentation

variable ax

float MPU9150::ax;

variable ay

float MPU9150::ay;

variable az

float MPU9150::az;

variable gx

float MPU9150::gx;

variable gy

float MPU9150::gy;

variable gz

float MPU9150::gz;

variable mx

float MPU9150::mx;

variable my

float MPU9150::my;

variable mz

float MPU9150::mz;

variable t

float MPU9150::t;

Protected Attributes Documentation

variable _Ascale

Ascale MPU9150::_Ascale;

variable _Gscale

Gscale MPU9150::_Gscale;

variable _Gscalings

const float MPU9150::_Gscalings[4];

variable _Ascalings

const float MPU9150::_Ascalings[4];

variable _mpu

I2CWrapper MPU9150::_mpu;

Public Functions Documentation

function MPU9150

MPU9150::MPU9150 (
    PinName sda,
    PinName scl
)

MPU9150 constructor

Parameters:

  • sda I2C SDA pin

  • scl I2C SDL pin

function update_motion

int MPU9150::update_motion ()

Get new data from acc/gyro sensors.

Returns:

0 on success, non-0 on fail

function update_mag

int MPU9150::update_mag ()

Get new data from magnetometer

Returns:

0 on success, non-0 on fail

function set_Ascale

void MPU9150::set_Ascale (
    Ascale scale
)

function set_Gscale

void MPU9150::set_Gscale (
    Gscale scale
)

Protected Functions Documentation

function calibrate

void MPU9150::calibrate ()

The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/MPU9150.h

Last updated