Chris Seto
/
mpu6050_test_basic_1
STM issues
Fork of mpu6050_test by
Diff: main.cpp
- Revision:
- 1:09d785823d44
- Parent:
- 0:84dda456d02c
--- a/main.cpp Fri Jan 11 00:58:23 2013 +0000 +++ b/main.cpp Tue Jul 01 23:29:27 2014 +0000 @@ -1,8 +1,8 @@ #include "mbed.h" #include "MPU6050.h" +#include "shared.h" DigitalOut myled(LED1); -Serial pc(USBTX, USBRX); MPU6050 mpu; int16_t ax, ay, az; @@ -10,23 +10,24 @@ int main() { - pc.printf("MPU6050 test\n\n"); - pc.printf("MPU6050 initialize \n"); + pc.baud(115200); + pc.printf("MPU6050 test\r\n"); + pc.printf("MPU6050 initialize \r\n"); mpu.initialize(); - pc.printf("MPU6050 testConnection \n"); + pc.printf("MPU6050 testConnection \r\n"); bool mpu6050TestResult = mpu.testConnection(); if(mpu6050TestResult) { - pc.printf("MPU6050 test passed \n"); + pc.printf("MPU6050 test passed \r\n"); } else { - pc.printf("MPU6050 test failed \n"); + pc.printf("MPU6050 test failed \r\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); + pc.printf("%d;%d;%d;%d;%d;%d\r\n",ax,ay,az,gx,gy,gz); } }