MPU6050 simple library
Dependents: MPU6050_test Drone MPU6050_test acelerometro ... more
Diff: MPU6050.cpp
- Revision:
- 10:31cec9253c7c
- Parent:
- 9:2dd52ac40c96
- Child:
- 16:002d3ac85242
--- a/MPU6050.cpp Thu Aug 15 03:22:38 2019 +0000 +++ b/MPU6050.cpp Thu Aug 15 03:29:07 2019 +0000 @@ -85,32 +85,3 @@ return _MPU6050.write(sad, &sub, 1, true) == 0 && _MPU6050.read(sad, buf, length) == 0; } - -/* sample code for Nucleo-F042K6 -#include "mbed.h" -#include "MPU6050.h" - -MPU6050 mpu(D7,D8); -Serial pc(USBTX,USBRX); - -float gx,gy,gz,ax,ay,az; - -int main() -{ - pc.baud(115200); - if(mpu.getID()==0x68) { - pc.printf("MPU6050 OK"); - wait(1); - } else { - pc.printf("MPU6050 error ID=0x%x\r\n",mpu.getID()); - while(1) { - } - } - mpu.start(); - while(1) { - mpu.read(&gx,&gy,&gz,&ax,&ay,&az); - pc.printf("gx,gy,gz,ax,ay,az %.1f,%.1f,%.1f,%.2f,%.2f,%.2f\r\n",gx,gy,gz,ax,ay,az); - wait(0.1); - } -} -*/