Skip to content

Conversation

hjmhardsoft
Copy link
Contributor

Hi Hafidhh
I have tested your library on an Arduino Leonardo Board, more exactly and Arduino Things Uno Board based on Arduino Leonardo architecture, and interrupt has not been working.
Researching for possible causes, i found that Interrupt Pin versus Interrupt Number, is not fixed on all boards, and arduino recommend to use the translation funcion attachInterrupt(digitalPinToInterrupt(this->_pin) as mentionated here https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/

I tested now and is working!

I hope this can help other users.

Best Regards

@hugojorgemuller

For the timer function to work correctly, the data type cannot be "int" because it overflows, but must be "unsigned long" just like the variable "millis()"
For the timer function to work correctly, the data type cannot be "int" because it overflows, but must be "unsigned long" just like the variable "millis()"
For the timer function to work correctly, the data type cannot be "int" because it overflows, but must be "unsigned long" just like the variable "millis()"
@hafidhh hafidhh merged commit fd549a0 into hafidhh:master Jan 11, 2023
@hafidhh
Copy link
Owner

hafidhh commented Jan 11, 2023

Thanks for fixing the error.
I haven't tried on Arduino Leonardo yet.

@hjmhardsoft
Copy link
Contributor Author

Hi Hafidhh
Thanks by the merge!.
I´m working with the library and a ThingsUno Board (simil UNO but Leonardo Core) and making suggestions to improve.

Regards

Hugo

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 this pull request may close these issues.

2 participants