High resolution barometer and altimeter using i2c mode

Dependents:   upverter_fitbit_clone ReadingMag_HMC5883L_work

Files at this revision

API Documentation at this revision

Comitter:
loopsva
Date:
Fri Nov 11 18:13:36 2016 +0000
Parent:
11:e0417b67a4b5
Commit message:
Intermediate v11 to v12 so top program can be comitted

Changed in this revision

ms5611.cpp Show annotated file Show diff for this revision Revisions of this file
ms5611.h Show annotated file Show diff for this revision Revisions of this file
diff -r e0417b67a4b5 -r e9a90b8c8688 ms5611.cpp
--- a/ms5611.cpp	Thu Dec 03 19:47:10 2015 +0000
+++ b/ms5611.cpp	Fri Nov 11 18:13:36 2016 +0000
@@ -21,7 +21,7 @@
 double A;                       // altitude (ft)
 double S;                       // sea level barometer (mB)
 
-uint32_t C[8];                  //coefficient storage
+//uint32_t C[8];                  //coefficient storage
 
 //--------------------------------------------------------------------------------------------------------------------------------------//
 // Constructor and destructor - default to be compatible with legacy m5611 driver
@@ -278,12 +278,16 @@
 //!
 //! @return none
 //********************************************************
+extern RawSerial pc;
 
 void ms5611::loadCoefs() {
+    pc.printf("\r\n   - Coefs: ");
     for (int i = 0; i < 8; i++){ 
         wait_ms(50);
         C[i] = cmd_prom(i);
+        pc.printf("%04x ", C[i]);
     }
+    pc.printf("\r\n");
     uint8_t n_crc = crc4(C);
 }
 
@@ -389,3 +393,4 @@
     S = pow(pow((P * INHG), 0.190284) + 0.00001313 * known_alt * FTMETERS , 5.2553026) * MB;
     return((float)S);
 } 
+
diff -r e0417b67a4b5 -r e9a90b8c8688 ms5611.h
--- a/ms5611.h	Thu Dec 03 19:47:10 2015 +0000
+++ b/ms5611.h	Fri Nov 11 18:13:36 2016 +0000
@@ -105,6 +105,7 @@
         CSBpin_0,  //CSB pin is grounded, I2C address is 0xEE and 0xEF
         CSBpin_1,  //CSB pin is tied to Vdd, I2C address is 0xEC and 0xED
     };
+    uint32_t C[8];
     /** Create a MS5611 object using the specified I2C object
      *   - User fixed I2C address 0xEE, CSB pin = 0
      *   - This is the default legacy constructor