issues
Dependents: mpu6050_test_basic_1
Fork of MPU6050 by
Diff: MPU6050.cpp
- Revision:
- 2:d7915dab2d3c
- Parent:
- 0:662207e34fba
--- a/MPU6050.cpp Wed May 08 00:34:55 2013 +0000 +++ b/MPU6050.cpp Tue Jul 01 23:24:17 2014 +0000 @@ -41,8 +41,9 @@ */ #include "MPU6050.h" +#include "shared.h" -#define useDebugSerial +//#define useDebugSerial //instead of using pgmspace.h typedef const unsigned char prog_uchar; @@ -52,7 +53,7 @@ /** Default constructor, uses default I2C address. * @see MPU6050_DEFAULT_ADDRESS */ -MPU6050::MPU6050() : debugSerial(USBTX, USBRX) +MPU6050::MPU6050() { devAddr = MPU6050_DEFAULT_ADDRESS; } @@ -63,7 +64,7 @@ * @see MPU6050_ADDRESS_AD0_LOW * @see MPU6050_ADDRESS_AD0_HIGH */ -MPU6050::MPU6050(uint8_t address) : debugSerial(USBTX, USBRX) +MPU6050::MPU6050(uint8_t address) { devAddr = address; } @@ -1899,6 +1900,12 @@ void MPU6050::getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz) { i2Cdev.readBytes(devAddr, MPU6050_RA_ACCEL_XOUT_H, 14, buffer); + + for (int i = 0; i < 14; i++) + { + pc.printf("%d", buffer[i]); + } + *ax = (((int16_t)buffer[0]) << 8) | buffer[1]; *ay = (((int16_t)buffer[2]) << 8) | buffer[3]; *az = (((int16_t)buffer[4]) << 8) | buffer[5];