Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
avandalen authored Apr 3, 2021
1 parent 2f8fd3e commit 0edf680
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions avdweb_Switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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..............................
Expand Down
3 changes: 2 additions & 1 deletion avdweb_Switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;

Expand Down

0 comments on commit 0edf680

Please sign in to comment.