diff --git a/DSTAT/src/experiment.c b/DSTAT/src/experiment.c index 458cbc79cce2e096647033712e44cb7142f26cc6..dcb5c23a2330f9803e68401e668c84acecc80114 100644 --- a/DSTAT/src/experiment.c +++ b/DSTAT/src/experiment.c @@ -139,10 +139,11 @@ void experiment_handler(char command){ if (o1 > 0) { if (settings.settings.tcs_enabled > 0){ tcs_readvalues(tcs_data); - delay_ms(25); tcs_readvalues(tcs_data1); // If sensor disconnected, second measurement should be exactly the same (unless 0 or saturated) - if (tcs_data[3] == tcs_data1[3]){ - if (!(tcs_data[3] == 0 || tcs_data[3] == 65535)) { + printf("#INFO: TCS0—%u %u %u %u\n\r", tcs_data[0], tcs_data[1], tcs_data[2], tcs_data[3]); + printf("#INFO: TCS1—%u %u %u %u\n\r", tcs_data1[0], tcs_data1[1], tcs_data1[2], tcs_data1[3]); + if (tcs_data[0] == tcs_data1[0]){ + if (!(tcs_data[0] == 0 || tcs_data[0] == 65535)) { printf("#ERR: Ambient light sensor seems to be disconnected \n\r"); return; }