Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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]);
}
}