add tcs34725 lux correction factor

master
interfisch 2 years ago
parent 5cea05e0be
commit ec3cee7db2
  1. 1
      platformio.ini
  2. 5
      src/main.cpp

@ -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

@ -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;

Loading…
Cancel
Save