diff --git a/platformio.ini b/platformio.ini index 8499eb2..c87cdc1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -38,6 +38,7 @@ build_flags = -D dataTCS34725_lux_minchange=500 -D dataTCS34725_lux_senddelaymax=1000*60*1 -D dataTCS34725_colortemp_minchange=100 + -D TCS34725_LUXFACTOR=0.3 #measured with luxmeter. with half tennis ball was 1.7ev less. 1/2^1.7=0,3078 -D SENSOR_HS1101 -D HS1101PIN=D5 diff --git a/src/main.cpp b/src/main.cpp index f097a33..c2ad2a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -188,6 +188,9 @@ struct sensordata uint16_t value_colortemp, value_tcs_lux, value_tcs_r,value_tcs_g,value_tcs_b,value_tcs_c; unsigned long lastread_tcs34725=0; #define TCS34725_MINLUXFORCT 30 //send only colortemperature values if lux is at least this high + #ifndef TCS34725_LUXFACTOR + #define TCS34725_LUXFACTOR 1 + #endif #endif #ifdef SENSOR_ANEMOMETER @@ -892,7 +895,7 @@ void loop_TCS34725_lux() } } //value_tcs_lux = tcs.calculateLux(value_tcs_r, value_tcs_g, value_tcs_b); - value_tcs_lux = tcs.lux; + value_tcs_lux = tcs.lux*TCS34725_LUXFACTOR; if (abs((int)d.lastsentvalue-value_tcs_lux)>=d.minchange){ //int abs _changed=true;