prog test sensor paris Saclay
Dependencies: mbed MS5803_paris_Saclay
Revision 1:6a130901be8c, committed 2021-09-22
- 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
--- /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
--- 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
--- 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