Skip to content

Commit 0edf680

Browse files
authored
Add files via upload
1 parent 2f8fd3e commit 0edf680

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

avdweb_Switch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ WEBSITE: http://www.avdweb.nl/arduino/hardware-interfacing/simple-switch-debounc
2020
1.2.0 29-09-2018 released
2121
1.2.1 30-11-2018 bugfix. Initialize time variables in the constructor. Fixes false event if first call to poll was delayed
2222
1.2.2 18-10-2019 beep when a switch is pressed with using a setBeepAllCallback function
23+
1.2.3 03-04-2020 made public: deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod
2324
2425
..........................................DEGLITCHING..............................
2526

avdweb_Switch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class Switch
3636
void setSingleClickCallback(switchCallback_t cb, void* param = nullptr);
3737
void setBeepAllCallback(switchCallback_t cb, void* param = nullptr);
3838

39+
int deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod;
40+
3941
protected:
4042
bool process(); // not inline, used in child class
4143
void inline deglitch();
@@ -47,7 +49,6 @@ class Switch
4749

4850
unsigned long deglitchTime, switchedTime, pushedTime, releasedTime, ms;
4951
const byte pin;
50-
const int deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod;
5152
const bool polarity;
5253
bool input, lastInput, equal, deglitched, debounced, _switched, _longPress, longPressDisable, _doubleClick, _singleClick, singleClickDisable;
5354

0 commit comments

Comments
 (0)