STM issues

Dependencies:   MPU6050 mbed

Fork of mpu6050_test by Simon Garfieldsg

Files at this revision

API Documentation at this revision

Comitter:
chris1seto
Date:
Tue Jul 01 23:29:27 2014 +0000
Parent:
0:84dda456d02c
Commit message:
STM issues

Changed in this revision

MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
shared.cpp Show annotated file Show diff for this revision Revisions of this file
shared.h Show annotated file Show diff for this revision Revisions of this file
diff -r 84dda456d02c -r 09d785823d44 MPU6050.lib
--- a/MPU6050.lib	Fri Jan 11 00:58:23 2013 +0000
+++ b/MPU6050.lib	Tue Jul 01 23:29:27 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/garfieldsg/code/MPU6050/#662207e34fba
+http://mbed.org/users/chris1seto/code/MPU6050/#d7915dab2d3c
diff -r 84dda456d02c -r 09d785823d44 main.cpp
--- 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);
     }
 }
diff -r 84dda456d02c -r 09d785823d44 mbed.bld
--- a/mbed.bld	Fri Jan 11 00:58:23 2013 +0000
+++ b/mbed.bld	Tue Jul 01 23:29:27 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/71b101360fb9
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file
diff -r 84dda456d02c -r 09d785823d44 shared.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shared.cpp	Tue Jul 01 23:29:27 2014 +0000
@@ -0,0 +1,3 @@
+#include "shared.h"
+
+Serial pc(SERIAL_TX, SERIAL_RX);
\ No newline at end of file
diff -r 84dda456d02c -r 09d785823d44 shared.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shared.h	Tue Jul 01 23:29:27 2014 +0000
@@ -0,0 +1,8 @@
+#ifndef SHARED_H
+#define SHARED_H
+
+#include "mbed.h"
+
+extern Serial pc;
+
+#endif
\ No newline at end of file