Plant Monitoring Project
Dependencies: mbed SHT21_ncleee WakeUp SSD1306 DHT Adafruit_TCS34725 DS1820
Revision 29:29df6820812c, committed 2019-12-09
- Comitter:
- Germaint
- Date:
- Mon Dec 09 08:52:09 2019 +0000
- Parent:
- 28:b1edf226ea9c
- Commit message:
- fork
Changed in this revision
--- a/define.hh Tue Dec 03 15:36:50 2019 +0000 +++ b/define.hh Mon Dec 09 08:52:09 2019 +0000 @@ -1,9 +1,9 @@ #pragma once -//#define DEBUG -#define SIGFOX +#define DEBUG +//#define SIGFOX #define FLOOR_TEMPERATURE -#define FLOOR_HUMIDITY -#define AIR_PARAMETERS -#define RGB -#define OLED +//#define FLOOR_HUMIDITY +//#define AIR_PARAMETERS +//#define RGB +//#define OLED
--- 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(){
--- a/main.hh Tue Dec 03 15:36:50 2019 +0000 +++ b/main.hh Mon Dec 09 08:52:09 2019 +0000 @@ -32,6 +32,8 @@ InterruptIn bouton(D10); // Capteurs +DigitalOut sensorsOFF(D9); + #ifdef FLOOR_TEMPERATURE DS1820 DS(D2); // temperature sol #endif