MPU9150 Class
- ID: mpu9150
- Name: Inertial Measurement Unit
- Other Names: Grove IMU 9DOF
- Category: accelerometer compass
- Manufacturer: seeed
- Link: http://www.seeedstudio.com/wiki/Grove_-_IMU_9DOF_v1.0
- Connection: i2c gpio
This module defines the MPU9150 interface for libmpu9150

Item Index
Methods
Methods
MPU9150
-
bus -
address -
magAddress -
enableAk8975
MPU9150 constructor
Parameters:
-
busNumberI2C bus to use
-
addressNumberThe address for this device
-
magAddressNumberThe address of the connected magnetometer
-
enableAk8975BooleanEnables i2c bypass mode for magnetometer, default is true
Returns:
init
()
Boolean
Set up initial values and start operation
Returns:
true if successful
update
()
Take a measurement and store the current sensor values internally. Note, these user facing registers are only updated from the internal device sensor values when the i2c serial traffic is 'idle'. So, if you are reading the values too fast, the bus may never be idle, and you will just end up reading the same values over and over.
Unfortunately, it is is not clear how long 'idle' actually means, so if you see this behavior, reduce the rate at which you are calling update() .
getMagnetometer
-
x -
y -
z
Return the compensated values for the x, y, and z axes. The unit of measurement is in micro-teslas (uT).
Parameters:
-
xFloat *Pointer to returned X axis value
-
yFloat *Pointer to returned Y axis value
-
zFloat *Pointer to returned Z axis value
getMagnetometer
()
Std::vector float
Return the compensated values for the x, y, and z axes. The unit of measurement is in micro-teslas (uT).
Returns:
std::vector containing X, Y, Z magnetometer values