-
Notifications
You must be signed in to change notification settings - Fork 94
Added CircuitPython_Button_Handler. #217
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
Conversation
|
I suggest using the adafruit_debouncer module rather than using sleep to implement a debounce. |
|
Actually, it might be even better to add functionality to adafruit_debouncer.Button. |
|
|
Thanks for the feedback! Now I'm left wondering if I should make the version based on , correct? |
|
Boards without |
|
Based on that, could work, or would the same issues arise? Also, I'm struggling to understand the last sentence on your response:
I'd appreciate it if you could explain that to me. |
|
Hello again! Just released version 2.0.0, which uses |
dhalbert
left a comment
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.
Sorry I did not see this earlier. Libraries don't need to be reviewed before they're added to the bundle. I looked at the API briefly: the only thing I'd suggest is that instead of using strings to different button inputs, use some enum-like construct, like a set of integers, or maybe different objects. So for instance
ButtonInput(ButtonInput.DOUBLE_PRESS, callback=double_press),or maybe
DoublePressInput(callback.double_press)|
Thanks for the feedback, @dhalbert! I added the changes in version 3.0.0. |
dhalbert
left a comment
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.
Thanks for this, and thanks for your patience during the review.
Added CircuitPython_Button_Handler, a helper library that handles different types of button presses such as short presses, long presses, double presses and holding actions.