Plant Monitoring Project

Dependencies:   mbed SHT21_ncleee WakeUp SSD1306 DHT Adafruit_TCS34725 DS1820

Revision:
29:29df6820812c
Parent:
27:05fb631b1f6e
--- a/main.cpp	Tue Dec 03 15:36:50 2019 +0000
+++ b/main.cpp	Mon Dec 09 08:52:09 2019 +0000
@@ -5,7 +5,7 @@
     bouton.rise(interruption_bouton);
     initOLED();
     #endif
-        
+    sensorsOFF = 1;
     while(1) {
       readData();
       wait(DUREE_OFF);
@@ -51,7 +51,7 @@
     if (!RGBsens.begin())
     {
         #ifdef DEBUG
-        pc.printf("No TCS34725 found ... check your connections");
+        pc.printf("No TCS34725 found ... check your connections\n\r");
         #endif
         //while (1); // halt!
     }
@@ -108,6 +108,8 @@
 #endif
 
 void readData(void){
+    sensorsOFF = 1;
+    wait(6);
     #ifdef DEBUG
     pc.printf("Reading Data\n\r");
     #endif
@@ -121,10 +123,12 @@
     temperature_air = sht.readTemp();
     humidity_air = sht.readHumidity();
     #endif
+    #ifdef AIR_PARAMETERS
     #ifdef DEBUG
     printf("hum air: %d\n\r", humidity_air);   
     printf("temp air: %.1f\n\r", temperature_air);  
     #endif
+    #endif
     #ifdef RGB  
     fct_RGB();
     #endif
@@ -135,6 +139,8 @@
     if(oled_on)
         oledData();
     #endif
+    wait(1);
+    sensorsOFF = 0;
 }
 
 void interruption_bouton(){