Plant Monitoring Project
Dependencies: mbed SHT21_ncleee WakeUp SSD1306 DHT Adafruit_TCS34725 DS1820
Diff: main.cpp
- Revision:
- 4:d7e305e06e1a
- Parent:
- 3:fc704c1d3087
- Child:
- 5:256a143ab0c2
--- a/main.cpp Tue Oct 08 14:38:36 2019 +0000 +++ b/main.cpp Tue Oct 08 15:08:01 2019 +0000 @@ -23,7 +23,7 @@ SHT21 sht(&i2c); // capteur RGB -Adafruit_TCS34725 RGBsens = Adafruit_TCS34725(&i2c, TCS34725_INTEGRATIONTIME_2_4MS, TCS34725_GAIN_16X); +Adafruit_TCS34725 RGBsens = Adafruit_TCS34725(&i2c, TCS34725_INTEGRATIONTIME_154MS, TCS34725_GAIN_16X); // capteur lumière AnalogIn ain(A1); @@ -31,8 +31,7 @@ // Définition de fonctions float temp_sol(void); int fct_humidity_sol(void); -void fct_RGB(unsigned char *pr, unsigned char *pg, unsigned char *pb, unsigned short *lux); -float fct_lumiere(void); +void fct_RGB(unsigned char *pr, unsigned char *pg, unsigned char *pb, unsigned short *lux); void sendDataSigfox(float tempSol, unsigned char *humSol, float tempAir, unsigned char *humAir, unsigned short *lux, unsigned char *R, unsigned char *G, unsigned char *B); void oledData(void); @@ -67,9 +66,6 @@ fct_RGB(&pr, &pg, &pb, &lum); //pc.printf("red=%d green=%d blue=%d\n\r", pr, pg, pb); - - //lum = fct_lumiere(); - //pc.printf("lumiere = %d\n\r", lum); oledData(); sendDataSigfox(temperature_sol, &humidity_sol, temperature_air, &humidity_air, &lum, &pr, &pg, &pb); @@ -116,17 +112,6 @@ *lux = clear; } -float fct_lumiere() -{ - float valueIn, logLux; - float logRange = 5.0; // 3.3v = 10^5 lux - - valueIn = ain.read(); - logLux = valueIn * logRange; - return pow(10, logLux); -} - - void sendDataSigfox(float tempSol, unsigned char *humSol, float tempAir, unsigned char *humAir, unsigned short *lux, unsigned char *R, unsigned char *G, unsigned char *B){ short tempSol_short, tempAir_short; tempSol *= 10;