prog test sensor paris Saclay

Dependencies:   mbed MS5803_paris_Saclay

Files at this revision

API Documentation at this revision

Comitter:
bouaziz
Date:
Wed Sep 22 16:18:19 2021 +0000
Parent:
0:02e1d738d7ad
Commit message:
programme test capteur ; prise en compte des corrections sur la lib ms5803

Changed in this revision

MS5803.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 02e1d738d7ad -r 6a130901be8c MS5803.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MS5803.lib	Wed Sep 22 16:18:19 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/TP_Ruche/code/MS5803_paris_Saclay/#7d839d3899f8
diff -r 02e1d738d7ad -r 6a130901be8c main.cpp
--- a/main.cpp	Sat Dec 05 10:31:10 2015 +0000
+++ b/main.cpp	Wed Sep 22 16:18:19 2021 +0000
@@ -1,29 +1,28 @@
 #include "mbed.h"
 
-I2C i2c(I2C_SDA, I2C_SCL);
+#include "MS5803.h"
+using namespace std;
 
-int addr = 0x00;
+//I2C i2c(PA_10,PA_9);
+
 
+ char tb[3];
+ Timer t1;
 int main()
 {
     bool ack;
-    
-    printf("\nstart\n");
-
-    i2c.frequency(100000);
-
-
+     // Initialize big pressure sensor
+    MS5803 big_sensor = MS5803(PA_10,PA_9, ms5803_addrCH);
+    big_sensor.MS5803Init();
+    float pressure_big;
+    float temp_big;
     while(1) {
         
-//sent data i2c     FIGURE 4-1
-        ack = i2c.write(addr,0x00,1);
-        wait_us(5);
-        
-        if(!ack) printf("I2C found @ %x\n",addr);
-        
-        if(addr>=0xFF) break;
-        addr++;
-    }
-    printf("stop\n\n");
-
+        big_sensor.Barometer_MS5803();
+        pressure_big = big_sensor.MS5803_Pressure();
+        temp_big = big_sensor.MS5803_Temperature();
+        printf("Press: %f ", pressure_big);
+        printf(" Temp: %f\r\n", temp_big);
+        wait(1.);      
+    }    
 }
\ No newline at end of file
diff -r 02e1d738d7ad -r 6a130901be8c mbed.bld
--- a/mbed.bld	Sat Dec 05 10:31:10 2015 +0000
+++ b/mbed.bld	Wed Sep 22 16:18:19 2021 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file