Josef Humer / Mbed 2 deprecated TTSMCU6050

Dependencies:   mbed rijo-mpu6050 MPU6050

rijompu6050.cpp

Committer:
rijo11811
Date:
2015-10-10
Revision:
0:c1875ecb8b79

File content as of revision 0:c1875ecb8b79:

#include "mbed.h"
#include "MPU6050.h"
Serial thinkdesk(USBTX, USBRX);
int16_t ax, ay, az;
int16_t gx, gy, gz;
MPU6050 mpu(p9,p10);


int main()
{

bool ok ;
ok = mpu.testConnection(); 
if(ok)
{
thinkdesk.printf("Test is ok!\n");
mpu.setSleepMode(0); //THIS WILL GET THE SENSOR OUT OF SLEEP MODE.
}
else
thinkdesk.printf("Test failed!\n");
float data[3];
while(1)
{
mpu.getAccelero( data );
wait(1);
thinkdesk.printf("%f;%f;%f;\n",data[0],data[1],data[2]);
}
}