prog test sensor paris Saclay

Dependencies:   mbed MS5803_paris_Saclay

Committer:
bouaziz
Date:
Wed Sep 22 16:18:19 2021 +0000
Revision:
1:6a130901be8c
Parent:
0:02e1d738d7ad
programme test capteur ; prise en compte des corrections sur la lib ms5803

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bi18rdbi18rd 0:02e1d738d7ad 1 #include "mbed.h"
bi18rdbi18rd 0:02e1d738d7ad 2
bouaziz 1:6a130901be8c 3 #include "MS5803.h"
bouaziz 1:6a130901be8c 4 using namespace std;
bi18rdbi18rd 0:02e1d738d7ad 5
bouaziz 1:6a130901be8c 6 //I2C i2c(PA_10,PA_9);
bouaziz 1:6a130901be8c 7
bi18rdbi18rd 0:02e1d738d7ad 8
bouaziz 1:6a130901be8c 9 char tb[3];
bouaziz 1:6a130901be8c 10 Timer t1;
bi18rdbi18rd 0:02e1d738d7ad 11 int main()
bi18rdbi18rd 0:02e1d738d7ad 12 {
bi18rdbi18rd 0:02e1d738d7ad 13 bool ack;
bouaziz 1:6a130901be8c 14 // Initialize big pressure sensor
bouaziz 1:6a130901be8c 15 MS5803 big_sensor = MS5803(PA_10,PA_9, ms5803_addrCH);
bouaziz 1:6a130901be8c 16 big_sensor.MS5803Init();
bouaziz 1:6a130901be8c 17 float pressure_big;
bouaziz 1:6a130901be8c 18 float temp_big;
bi18rdbi18rd 0:02e1d738d7ad 19 while(1) {
bi18rdbi18rd 0:02e1d738d7ad 20
bouaziz 1:6a130901be8c 21 big_sensor.Barometer_MS5803();
bouaziz 1:6a130901be8c 22 pressure_big = big_sensor.MS5803_Pressure();
bouaziz 1:6a130901be8c 23 temp_big = big_sensor.MS5803_Temperature();
bouaziz 1:6a130901be8c 24 printf("Press: %f ", pressure_big);
bouaziz 1:6a130901be8c 25 printf(" Temp: %f\r\n", temp_big);
bouaziz 1:6a130901be8c 26 wait(1.);
bouaziz 1:6a130901be8c 27 }
bi18rdbi18rd 0:02e1d738d7ad 28 }