Added CircuitPython_Button_Handler.#217
Added CircuitPython_Button_Handler.#217dhalbert merged 2 commits intoadafruit:mainfrom EGJ-Moorington:main
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.
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.
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.