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
452 stars 63 forks source link

Clarify in Docs what INTERUPT is #71

Open spuder opened 2 years ago

spuder commented 2 years ago

The documentation is fantastic, the best I've ever seen.

On this page there is documentation on how to enable interupts

https://easybtn.earias.me/docs/fundamentals

Screen Shot 2022-08-09 at 7 58 07 PM

Yet its not clear what INTERUPT should be.

Should INTERUPT be the pin on the arduino? ❌

void buttonISR()
{
  button.read(2); 
}

Should INTERUPT be the Interupt name on the arduino? ❌

void buttonISR()
{
  button.read(INT.1); 
}

https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/

Should INTERUPT be the string litteral 'INTERUPT' ? ❌

void buttonISR()
{
  button.read(INTERUPT); 
}
src/main.cpp:91:15: error: 'INTERUPT' was not declared in this scope

Sorry if this is a beginner question. If I'm running into this obstacle, most likely someone else is too.

spuder commented 2 years ago

Looking at the interrupt example in the examples folder shows that no interupt is provided to button.read().

https://github.com/evert-arias/EasyButton/blob/main/examples/Interrupts/Interrupts.ino#L31