diff --git a/ls_sensor.ino b/ls_sensor.ino index 59104674..07c3d735 100644 --- a/ls_sensor.ino +++ b/ls_sensor.ino @@ -86,7 +86,11 @@ inline unsigned short readZ() { // returns the raw Z value short rawZ; - if (controlModeActive) { + rawZ = 4095 - spiAnalogRead(); + + if (rawZ < 10) { + // just proceed - a very low value rarely settles high + } else if (controlModeActive) { delayUsec(READZ_DELAY_CONTROLMODE); // read raw Z value and invert it from (4095 - 0) to (0-4095)