A library for the Invensense MPU9150

Dependencies:   I2CHelper

Dependents:   Atlas_Test

MPU9150.cpp

Committer:
ethanharstad
Date:
2014-06-04
Revision:
1:1b0ada1695a7
Parent:
0:d6616b97605d
Child:
2:581fad93a809

File content as of revision 1:1b0ada1695a7:

#include "MPU9150.h"
#include "mbed.h"

MPU9150::MPU9150() : i2c_(I2C_SDA, I2C_SCL) {
    address_ = MPU9150_ADDRESS_DEFAULT;
}

MPU9150::MPU9150(const bool AD0) : i2c_(I2C_SDA, I2C_SCL) {
    if(AD0) {
        address_ = MPU9150_ADDRESS_AD0_HIGH;
    } else {
        address_ = MPU9150_ADDRESS_AD0_LOW;
    }
}

MPU9150::MPU9150(const PinName sda, const PinName scl, const bool AD0) : i2c_(sda, scl) {
    if(AD0) {
        address_ = MPU9150_ADDRESS_AD0_HIGH;
    } else {
        address_ = MPU9150_ADDRESS_AD0_LOW;
    }
}