Add first draft for pressure calulation a see level

This commit is contained in:
Mathieu Maret 2016-03-25 00:06:33 +01:00
parent ff6ab5755d
commit d51df5dd64

View File

@ -1,3 +1,6 @@
// Get Current altitude with http://fr.mygeoposition.com/
#define ALTITUDE 130
SFE_BMP180 bmp180; SFE_BMP180 bmp180;
int bmp180Connected = 0; int bmp180Connected = 0;
@ -32,9 +35,11 @@ int BMP180GetTempAndPressure(double &t, double &p) {
{ {
delay(status); delay(status);
status = bmp180.getPressure(p, t); status = bmp180.getPressure(p, t);
if (status != 0) if (status != 0){
p = bmp180.sealevel(p, ALTITUDE);
return 0; return 0;
} }
} }
}
return -1; return -1;
} }