Hi there,
I am trying to use a Sparkfun MPU6050 breakout board and using the following code:
#include "mbed.h"
#include "MPU6050.h"
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
MPU6050 mpu;
int16_t ax, ay, az;
int16_t gx, gy, gz;
int main()
{
pc.printf("MPU6050 test\n\n");
pc.printf("MPU6050 initialize \n");
mpu.initialize();
pc.printf("MPU6050 testConnection \n");
bool mpu6050TestResult = mpu.testConnection();
if(mpu6050TestResult) {
pc.printf("MPU6050 test passed \n");
} else {
pc.printf("MPU6050 test failed \n");
}
while(1) {
//wait(1);
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
//writing current accelerometer and gyro position
pc.printf("%d;%d;%d;%d;%d;%d\n",ax,ay,az,gx,gy,gz);
}
}
Along with this, using the libraries found here:
http://mbed.org/users/garfieldsg/code/mpu6050_test/
Unfortunatley, this code stops running after 1129 I2C reads. As far as I could tell, the code stops in the I2Cdev.cpp file at line 140,
i2c.read(devAddr<<1, redData, length);
Does anyone know a fix for this? I think it has something to do with the mbed's memory, but I'm relatively new to the mbed so I'm not exactly sure.
The board is wired correctly, all pull up resistors etc are in place.
Any help would be greatly appreciated!
Hi there,
I am trying to use a Sparkfun MPU6050 breakout board and using the following code:
Along with this, using the libraries found here:
http://mbed.org/users/garfieldsg/code/mpu6050_test/
Unfortunatley, this code stops running after 1129 I2C reads. As far as I could tell, the code stops in the I2Cdev.cpp file at line 140,
Does anyone know a fix for this? I think it has something to do with the mbed's memory, but I'm relatively new to the mbed so I'm not exactly sure.
The board is wired correctly, all pull up resistors etc are in place.
Any help would be greatly appreciated!