-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing debounce_threshold in keypad.py #1044
Changes from 8 commits
4d684a5
cd0b023
a371c85
b7e41f5
fdd5fdd
5269340
458a2f8
a39744a
6a67ec0
914abbf
192bd40
e1d1b61
de212c9
8ccf24e
da47bc1
8035917
3fb4952
cbb14e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,8 @@ class MyKeyboard(KMKKeyboard): | |
row_pins=self.row_pins, | ||
# optional arguments with defaults: | ||
columns_to_anodes=DiodeOrientation.COL2ROW, | ||
interval=0.02, # Debounce time in floating point seconds | ||
interval=0.01, # How often the matrix is sampled | ||
debounce_threshold=5, # Number of samples needed to change state | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a strong opinion on keeping the upstream default, even if it's "maybe suboptimal". Make a note in the docs that values around 5 are tested and should work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way KMK is used we'd need this information in getting started... I'd prefer the minimum viable config to remain within its current scope. |
||
max_events=64 | ||
) | ||
|
||
|
@@ -68,7 +69,8 @@ class MyKeyboard(KMKKeyboard): | |
# optional arguments with defaults: | ||
value_when_pressed=False, | ||
pull=True, | ||
interval=0.02, # Debounce time in floating point seconds | ||
interval=0.01, # How often the matrix is sampled | ||
debounce_threshold=5, # Number of samples needed to change state | ||
max_events=64 | ||
) | ||
``` | ||
|
@@ -94,7 +96,8 @@ class MyKeyboard(KMKKeyboard): | |
# optional arguments with defaults: | ||
value_to_latch=True, # 74HC165: True, CD4021: False | ||
value_when_pressed=False, | ||
interval=0.02, # Debounce time in floating point seconds | ||
interval=0.01, # How often the matrix is sampled | ||
debounce_threshold=5, # Number of samples needed to change state | ||
max_events=64 | ||
) | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other parameter lists. ("how often" means frequency btw, which is the inverse).