prog test sensor paris Saclay
Dependencies: mbed MS5803_paris_Saclay
Diff: main.cpp
- Revision:
- 1:6a130901be8c
- Parent:
- 0:02e1d738d7ad
--- 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