From 0edf680a25701c30ecf1559e4bd4f2434c4ddeeb Mon Sep 17 00:00:00 2001 From: Albert van Dalen Date: Sat, 3 Apr 2021 14:25:56 +0200 Subject: [PATCH] Add files via upload --- avdweb_Switch.cpp | 1 + avdweb_Switch.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/avdweb_Switch.cpp b/avdweb_Switch.cpp index 061a3d6..c5fd143 100644 --- a/avdweb_Switch.cpp +++ b/avdweb_Switch.cpp @@ -20,6 +20,7 @@ WEBSITE: http://www.avdweb.nl/arduino/hardware-interfacing/simple-switch-debounc 1.2.0 29-09-2018 released 1.2.1 30-11-2018 bugfix. Initialize time variables in the constructor. Fixes false event if first call to poll was delayed 1.2.2 18-10-2019 beep when a switch is pressed with using a setBeepAllCallback function +1.2.3 03-04-2020 made public: deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod ..........................................DEGLITCHING.............................. diff --git a/avdweb_Switch.h b/avdweb_Switch.h index 9cf44d0..42eb267 100644 --- a/avdweb_Switch.h +++ b/avdweb_Switch.h @@ -36,6 +36,8 @@ class Switch void setSingleClickCallback(switchCallback_t cb, void* param = nullptr); void setBeepAllCallback(switchCallback_t cb, void* param = nullptr); + int deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod; + protected: bool process(); // not inline, used in child class void inline deglitch(); @@ -47,7 +49,6 @@ class Switch unsigned long deglitchTime, switchedTime, pushedTime, releasedTime, ms; const byte pin; - const int deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod; const bool polarity; bool input, lastInput, equal, deglitched, debounced, _switched, _longPress, longPressDisable, _doubleClick, _singleClick, singleClickDisable;