From ab7dc45d9409fa2d0341b40f7bcc659b0f90ed03 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 7 Nov 2021 11:00:39 +0100 Subject: [PATCH] fix spelling error on ldr --- include/sensor_ldr.cpp | 2 +- include/sensor_ldr.h | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/sensor_ldr.cpp b/include/sensor_ldr.cpp index 2a30c48..5e3a0b9 100644 --- a/include/sensor_ldr.cpp +++ b/include/sensor_ldr.cpp @@ -40,7 +40,7 @@ void Sensor_LDR::sensorloop() bool _changed=false; if (millis() >= (d.lastreadtime+d.readdelay)) { - d.value = get_lux(in_ldr, out_ldr, LDR_ARRAYSIZE)/10.0; //read light level in lux + d.value = get_lux(in_ldr, out_ldr, SENSOR_LDR_ARRAYSIZE)/10.0; //read light level in lux if (fabs(d.lastsentvalue-d.value)>=d.minchange){ _changed=true; } diff --git a/include/sensor_ldr.h b/include/sensor_ldr.h index ed3a0be..21149a5 100644 --- a/include/sensor_ldr.h +++ b/include/sensor_ldr.h @@ -17,18 +17,15 @@ private: struct sensordata data; //struct values are changed in setup() int get_lux(const unsigned int* _in, const unsigned int* _out, byte size); - - //wemos d1 mini, black wire of ldr connects to A0 with 10k to gnd. red wire connects with 1k to gnd and 2k2 to 3v3 + #ifdef SENSOR_LDR_CALIB_1 - #define LDRARRAYSIZE 18 + #define SENSOR_LDR_ARRAYSIZE 18 const unsigned int out_ldr[18] = {0, 30, 50, 60, 130, 170, 250, 420, 780, 1300,2600, 5000, 5350, 7700, 10900, 12000, 17000,20000}; // x10 (i.e. gets later divided by 10) const unsigned int in_ldr[18] = {0, 12, 100, 150, 350, 400, 450, 650, 730, 780, 840, 930, 948 , 970, 993, 1005, 1019, 1023}; // 0 - 1023 #endif - - - + bool init_ok; public: Sensor_LDR(int p);