Correction de la lib car erreur de format dans les calculs

Files at this revision

API Documentation at this revision

Comitter:
rkk
Date:
Thu Jul 24 04:47:54 2014 +0000
Parent:
0:d558dda1e821
Child:
2:3e5c7afef8f8
Commit message:
adjusted library to make it more universal;

Changed in this revision

MS5803.cpp Show annotated file Show diff for this revision Revisions of this file
MS5803.h Show annotated file Show diff for this revision Revisions of this file
--- a/MS5803.cpp	Thu Jul 24 04:19:39 2014 +0000
+++ b/MS5803.cpp	Thu Jul 24 04:47:54 2014 +0000
@@ -17,10 +17,13 @@
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.
 
-  * Barometer Sensor (Altimeter) MS5803-01BA of MEAS Switzerland     (www.meas-spec.com).
-  * The driver uses I2C mode (sensor PS pin low).
-  * Other types of MEAS are compatible but not tested.
-  * Written by Raig Kaufer distribute freely!
+  * Library for Pressure Sensors of type MS5803-x of MEAS Switzerland     (www.meas-spec.com).
+  * The driver uses I2C mode (sensor's Protocol Select (PS) pin pulled to high). 
+  * MS5803-01BA was successfully tested by Raig Kaufer.
+  * MS5803-14BA (Underwater Pressure Sensor 14 bar) was successfully tested by Robert Katzschmann
+  * Other types of MEAS are compatible but not tested 
+  * Written by Raig Kaufer, distribute freely!
+  * Revised by Robert Katzschmann
  */
 
 #include <stdlib.h>
@@ -36,7 +39,7 @@
     /* transmit out 1 byte reset command */
     ms5803_tx_data[0] = ms5803_reset;
     if ( i2c.write( device_address,  ms5803_tx_data, 1 ) );
-    printf('send soft reset');
+    printf("send soft reset");
     wait_ms(20);
 }
 
--- a/MS5803.h	Thu Jul 24 04:19:39 2014 +0000
+++ b/MS5803.h	Thu Jul 24 04:47:54 2014 +0000
@@ -17,10 +17,13 @@
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.
 
-  * Miniature 14 bar Module MS5803-14BA of MEAS Switzerland     (www.meas-spec.com).
-  * The driver uses I2C mode (sensor's Protocol Select (PS) pin pulled to high).
-  * Other types of MEAS are compatible but not tested (only MS5803-01BA was tested by Raig Kaufer).
-  * Written by Raig Kaufer distribute freely!
+  * Library for Pressure Sensors of type MS5803-x of MEAS Switzerland     (www.meas-spec.com).
+  * The driver uses I2C mode (sensor's Protocol Select (PS) pin pulled to high). 
+  * MS5803-01BA (Barometer Sensor (Altimeter)) was successfully tested by Raig Kaufer.
+  * MS5803-14BA (Underwater Pressure Sensor 14 bar) was successfully tested by Robert Katzschmann
+  * Other types of MEAS are compatible but not tested 
+  * Written by Raig Kaufer, distribute freely!
+  * Revised by Robert Katzschmann
  */
 #include "mbed.h"
 
@@ -30,11 +33,10 @@
 #define MS5803_RX_DEPTH 3
 #define MS5803_TX_DEPTH 2
 
+// choose your connection here
 #define ms5803_addrCL 0x77 //0b1110111  CSB Pin is low
 #define ms5803_addrCH 0x76 //0b1110110  CSB Pin is high 
 
-#define ms5803_base_addr ms5803_addrCH // choose your connection here
-
 #define ms5803_reset       0x1E // Sensor Reset
 
 #define ms5803_convD1_256  0x40 // Convert D1 OSR 256
@@ -66,7 +68,7 @@
 
 public:
     MS5803 (PinName sda, PinName scl,
-            char ms5803_addr = ms5803_base_addr  )
+            char ms5803_addr = ms5803_addrCH  )
             : i2c( sda, scl ), device_address( ms5803_addr << 1 ) {
     }
     void MS5803Reset(void);