evert-arias / EasyButton

Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
https://easybtn.earias.me
MIT License
447 stars 62 forks source link

Update the docs on how to use interrupts to match examples #93

Open shampeon opened 2 months ago

shampeon commented 2 months ago

There's a mismatch between how interrupts are documented and how they are used in the example code.

The docs describe how to use the function attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), buttonPressed, FALLING); to enable interrupts on a button. This function is encapsulated by the enableInterrupt() function, used in the examples. While it might be useful to document the lower level attachInterrupt() function, the docs should show how to use enableInterrupt() first, and then show what's happening within enableInterrupt().