Compare Chart - TanPitch/ButtonKing GitHub Wiki
The ButtonKing library is the improved version of the OneButton that use to add more events to a single pushbutton. It shows how to use an digital input pin with a single pushbutton attached for detecting some of the typical button press events. This enables you to reuse the same button for multiple functions and lowers the hardware invests.
These're all events that ButtonKing can detect compare to OneButton library.
Events | OneButton | ButtonKing | new ButtonKing |
---|---|---|---|
single click | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
double clicks | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
short-time pressing | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
long-time pressing | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: |
long-time releasing | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
is button pressing | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: |
duration from press to release | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: |
short-time pressing after single click | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: |
long-time pressing after single click | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: |
long-time releasing after single click | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: |
triple click | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_check_mark: |
short-time pressing after double click ( will add ) | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_check_mark: |
long-time pressing after double click ( will add ) | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_check_mark: |
long-time releasing after double click ( will add ) | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_check_mark: |
click counter ( will add ) | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_check_mark: |
- is button pressing can detect by long-time action
- duration from press to release can calculate from interval between short-time releasing and long-time pressing
- triple click can detect by single click action after the double click action