From 063cc8aae13bf8dc3f2f2e6b38abf8996c1f079b Mon Sep 17 00:00:00 2001 From: chriswin Date: Fri, 9 Jan 2026 00:15:47 +0100 Subject: [PATCH] License and small improvement for debut --- LICENSE | 7 +++++++ hmmd-sensor-waveshare.ino | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3fcd10b --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2026 chriswin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/hmmd-sensor-waveshare.ino b/hmmd-sensor-waveshare.ino index 9342c74..b1ecc98 100644 --- a/hmmd-sensor-waveshare.ino +++ b/hmmd-sensor-waveshare.ino @@ -5,7 +5,7 @@ // Normal mode command #define COMMAND "FDFCFBFA0800120000006400000004030201" -#define PRESENCE_DISTANCE 100 +#define PRESENCE_DISTANCE 120 #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 @@ -16,6 +16,7 @@ ZigbeeOccupancySensor zbOccupancySensor = ZigbeeOccupancySensor(OCCUPANCY_SENSOR bool isPresent = false; unsigned long lastMotionDetected = 0; // time when the last motion was detected +unsigned long lastCheck = 0; // time it was checked void setup() { initSerial(); @@ -101,6 +102,7 @@ void readAndProcessSensorLines() { String distanceStr = line.substring(6); int distance = distanceStr.toInt(); bool currentStatus = distance <= PRESENCE_DISTANCE; + //Serial.println("Distance " + String(distance) + " | Status:" + String(currentStatus)); if (currentStatus == 1) { lastMotionDetected = millis();