Skip to content

Commit

Permalink
added possibility to define your own timouts, as suggested in #10
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartHennigs committed Apr 16, 2020
1 parent 4927c83 commit b06fb47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.DS_Store
.vscode

.vscode
2 changes: 1 addition & 1 deletion src/Button2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void Button2::loop() {
click_count = 0;
click_ms = 0;
}
yield();
// yield();
}

/////////////////////////////////////////////////////////////////
Expand Down
12 changes: 9 additions & 3 deletions src/Button2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@

/////////////////////////////////////////////////////////////////

#define DEBOUNCE_MS 50
#define LONGCLICK_MS 200
#define DOUBLECLICK_MS 300
#ifndef DEBOUNCE_MS
#define DEBOUNCE_MS 50
#endif
#ifndef LONGCLICK_MS
#define LONGCLICK_MS 200
#endif
#ifndef DOUBLECLICK_MS
#define DOUBLECLICK_MS 300
#endif

#define SINGLE_CLICK 1
#define DOUBLE_CLICK 2
Expand Down

0 comments on commit b06fb47

Please sign in to comment.