Skip to content
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

Interrupt example not working with 1.2.1 #40

Open
octave opened this issue Apr 9, 2020 · 9 comments · Fixed by #38
Open

Interrupt example not working with 1.2.1 #40

octave opened this issue Apr 9, 2020 · 9 comments · Fixed by #38

Comments

@octave
Copy link

octave commented Apr 9, 2020

With version 1.2.1 on Interrupt example:

button.read(INTERRUPT); generates: error: 'INTERRUPT' was not declared in this scope

@evert-arias
Copy link
Owner

Hi @octave
I will take a look at it and get back to you. I appreciate your feedback.

@evert-arias
Copy link
Owner

evert-arias commented Apr 9, 2020

@octave
This is what is happening. In v1.2.1 we fixed an issue with the INTERRUPT macro as it was already defined in the arduino environment. To fix such problem, we renamed INTERRUPT to EASYBUTTON_READ_TYPE_INTERRUPT. This update should have been released as a major version update since it was a breaking change.

We will be fixing this error as well as update the corresponding examples in v2.0 soon.
Meanwhile all you have to do is use EASYBUTTON_READ_TYPE_INTERRUPT instead of INTERRUPT when calling the read method as follow:

void buttonISR()
{
 read() function
  button.read(EASYBUTTON_READ_TYPE_INTERRUPT);
}

I am very sorry for this inconvenience and I appreciate your feedback.

@evert-arias
Copy link
Owner

Hi @octave
In version 2.0, that has been released today, there is no need to pass any arguments when calling the button.read() function. There more features included in this release, feel free to give it a try.

https://github.com/evert-arias/EasyButton/releases/tag/v2.0.0

@evert-arias evert-arias unpinned this issue Apr 11, 2020
@MattStarfield
Copy link

@evert-arias reminder to update the website documentation to reflect this change. I just updated to v2.0 and was spinning my wheels for a few hours until I found this thread.

https://easybtn.earias.me/docs/fundamentals#external-interrupts

@MattStarfield
Copy link

The Interrupts.ino example also still includes the comment to use the INTERRUPT parameter:

void buttonISR()
{
  /*
    When button is being used through external interrupts, 
    parameter INTERRUPT must be passed to read() function
   */
  button.read();
}

Awesome work on this super useful library. Thanks for all of your effort!!

@evert-arias
Copy link
Owner

Hi @mattgarfield
I will fix that as soon as possible. Thank you very much for your comment, I really appreciate your feedback.

@pnaybour
Copy link

pnaybour commented Sep 4, 2021

Has the documentation been updated yet?

@wanggaoteng
Copy link

Please update the document, 2022.04.26

@goutamreddy
Copy link

Please update the documentation, 2022.10.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants