Projet Long pour AGRAL

Dependencies:   mbed OneWire DHT22 TSL2561 SSD1306

Files at this revision

API Documentation at this revision

Comitter:
Pipou
Date:
Mon Jan 22 09:06:59 2018 +0000
Parent:
11:7c872ac9da9a
Commit message:
Final version 1.0

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 7c872ac9da9a -r 9a8b32c34787 main.cpp
--- a/main.cpp	Mon Nov 20 15:33:30 2017 +0000
+++ b/main.cpp	Mon Jan 22 09:06:59 2018 +0000
@@ -23,7 +23,7 @@
 
 //Déclaration variables
 TSL2561 Lum(PB_7,PB_6); // Luminosité (I2C:SDA,SCL)
-DHT22 Tem_Hum_A(PA_11); // Température & Humidité air
+//DHT22 Tem_Hum_A(PA_11); // Température & Humidité air
 OneWire Tem_S(PA_8); // Température sol
 AnalogIn Hum_S(PA_0); // Huminidité sol
 Serial pc(PA_2,PA_3); //Serial : Tx,Rx
@@ -52,21 +52,21 @@
 
         owDevice->generateId(_id);
         
-        Tem_Hum_A.sample();
+        //Tem_Hum_A.sample();
 
         // Calcul sur les données envoyées par les capteurs
         float Lumux = Lum.lux();
-        float Temp_Air = Tem_Hum_A.getTemperature()/10.0;
-        float Hum_Air = Tem_Hum_A.getHumidity()/10.0;
+        //float Temp_Air = Tem_Hum_A.getTemperature()/10.0;
+        //float Hum_Air = Tem_Hum_A.getHumidity()/10.0;
         float Temp_Sol = owDevice->sendGetCommand(GET_TEMPERATURE);
         float Hum_Sol = Hum_S.read();
         
         // Affichage données, mises en forme, sur la console
-        printf( "Lum: %.2f \tTemp_A: %.2f \tHum_A: %.2f \tTemp_S: %.2f \tHum_S: %.2f\r\n", Lumux, Temp_Air, Hum_Air, Temp_Sol, Hum_Sol);
+        printf( "Lum: %.2f \tTemp_A: %.2f \tHum_A: %.2f \tTemp_S: %.2f \tHum_S: %.2f\r\n", Lumux, 0, 0, Temp_Sol, Hum_Sol);
         
         // Envoie données, mises en forme, sur ACTOBOARD
         sigfox.printf("AT$SF=");
-        sigfox.printf("%02x%02x%02x%02x%02x",(int)Lumux,(int)Temp_Air,(int)Hum_Air,(int)Temp_Sol,(int)Hum_Sol);
+        sigfox.printf("%02x%02x%02x%02x%02x",(int)Lumux,(int)0,(int)0,(int)Temp_Sol,(int)Hum_Sol);
         sigfox.printf("\n\r");
         
         delete owDevice;   
@@ -80,8 +80,8 @@
         oled.printf("\r\n");
         oled.set_font(standard_font, 6);
         oled.printf("Lum: %.2f\r\n", Lumux);    
-        oled.printf("Temp_A: %.2f\r\n", Temp_Air);
-        oled.printf("Hum_A: %.2f\r\n", Hum_Air);
+        oled.printf("Temp_A: %.2f\r\n", 1);
+        oled.printf("Hum_A: %.2f\r\n", 1);
         oled.printf("Temp_S: %.2f\r\n",Temp_Sol);
         oled.printf("Hum_S: %.2f\r\n", Hum_Sol);
         oled.printf("\r\n");