Mathieu Moneyron / Mbed 2 deprecated projetS1

Dependencies:   HP206C mbed HMC5883L DHT DS1820

Revision:
62:d902b1e77094
Parent:
56:d9557c842d5d
Child:
64:7adaa9dfcb8c
--- a/main.cpp	Tue Oct 09 11:47:36 2018 +0000
+++ b/main.cpp	Tue Oct 09 12:27:17 2018 +0000
@@ -14,7 +14,7 @@
 
 int main() {
     while(1) {
-        float airH = 0, tmpH, tmpT, airT = 0;
+        float airH = 0,airT = 0;
         char *message;
         int16_t magXYZ[3];
         unsigned long alt;
@@ -37,15 +37,7 @@
         //collect data
         alt = readAltitude(&hp206c);
         hmc5883.getXYZ(magXYZ);
-        tmpH = airHumidity(sensor);
-        if( tmpH!=0){
-            airH = tmpH;
-        }
-        wait(2);
-        tmpT = airTemperature(sensor);
-        if( tmpT!=0 ){
-            airT=tmpT;
-        }
+        get_T_H_air(&airT, &airH, sensor)
         
         // Display
         pc.printf("\n=====| Data |=====\n");