diff --git a/hmmd-sensor-waveshare.ino b/hmmd-sensor-waveshare.ino index b1ecc98..eb30018 100644 --- a/hmmd-sensor-waveshare.ino +++ b/hmmd-sensor-waveshare.ino @@ -5,9 +5,8 @@ // Normal mode command #define COMMAND "FDFCFBFA0800120000006400000004030201" -#define PRESENCE_DISTANCE 120 +#define PRESENCE_DISTANCE 140 #define DELAY_STATUS_CHECK 1000 // delay (in ms) between two checks of the presence -#define POWER_DELAY 20000 // delay (in ms) until turning off the screen // Zigbee #define OCCUPANCY_SENSOR_ENDPOINT_NUMBER 1 @@ -112,10 +111,10 @@ void readAndProcessSensorLines() { isPresent = true; bool res = sendZigbeeOnOffCommand(isPresent); Serial.println("Motion detected, turning screen light on"); - } else if (!currentStatus && isPresent && (millis() - lastMotionDetected >= POWER_DELAY)) { + } else if (!currentStatus && isPresent) { isPresent = false; bool res = sendZigbeeOnOffCommand(isPresent); - Serial.printf("No motion detected for %d ms, turning light off.\n", POWER_DELAY); + Serial.printf("No motion detected, turning light off.\n"); } } }