SkipperS2v2 and bmp

Dependencies:   BMP280 mpu9250forskipper mbed

Files at this revision

API Documentation at this revision

Comitter:
motoseki
Date:
Mon Aug 22 02:51:01 2016 +0000
Parent:
1:5c8e961811d1
Commit message:
for bmp280

Changed in this revision

MPU9250.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
diff -r 5c8e961811d1 -r c1c7afb86416 MPU9250.lib
--- a/MPU9250.lib	Mon Aug 15 10:07:24 2016 +0000
+++ b/MPU9250.lib	Mon Aug 22 02:51:01 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/imanyonok/code/MPU9250/#afcfba8468f1
+https://developer.mbed.org/users/motoseki/code/mpu9250forskipper/#afcfba8468f1
diff -r 5c8e961811d1 -r c1c7afb86416 main.cpp
--- a/main.cpp	Mon Aug 15 10:07:24 2016 +0000
+++ b/main.cpp	Mon Aug 22 02:51:01 2016 +0000
@@ -13,9 +13,11 @@
 
 float sum = 0;
 uint32_t sumCount = 0;
+float bmpTEM , bmpPRE;
 MPU9250 mpu9250;
 BMP280 bmp(PC_9, PA_8 ,bmpadr);    //(PinName sda, PinName scl, char slave_adr)
 Timer t;
+float PRES_first;
 
 int main() {
     wait(2);
@@ -54,12 +56,7 @@
   
   //BMP initialize
   bmp.initialize();
-  
-  while(1){
-      pc.printf("TEM : %f, PRE : %f\n",bmp.getTemperature(),bmp.getPressure());
-      wait_ms(500);
-  }
-  
+  PRES_first = bmp.getPressure();
     
   // Read the WHO_AM_I register, this is a good test of communication
   uint8_t whoami = mpu9250.readByte(MPU9250_ADDRESS, WHO_AM_I_MPU9250);  // Read WHO_AM_I register for MPU-9250
@@ -96,9 +93,8 @@
    {
     pc.printf("Could not connect to MPU9250: \n\r");
     pc.printf("%#x \n",  whoami);
- 
     
- 
+    
     while(1) ; // Loop forever if communication doesn't happen
     }
 
@@ -196,8 +192,12 @@
     yaw   -= 13.8f; // Declination at Danville, California is 13 degrees 48 minutes and 47 seconds on 2014-04-04
     roll  *= 180.0f / PI;
 
-    pc.printf("Yaw,   Pitch,   Roll:  %f  %f  %f \n\r",  yaw,   pitch,   roll);
+    //pc.printf("Yaw,   Pitch,   Roll:  %f  %f  %f \n\r",  yaw,   pitch,   roll);
     //pc.printf("average rate = %f\n\r", (float) sumCount/sum);
+    
+    bmpTEM=bmp.getTemperature();
+    bmpPRE=bmp.getPressure();    
+    pc.printf("PRE : %f\n",bmpPRE - PRES_first);
  
     myled= !myled;
     count = t.read_ms(); 
diff -r 5c8e961811d1 -r c1c7afb86416 mbed.bld
--- a/mbed.bld	Mon Aug 15 10:07:24 2016 +0000
+++ b/mbed.bld	Mon Aug 22 02:51:01 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/f9eeca106725
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/b0220dba8be7
\ No newline at end of file