We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hello,
thank you for providing this code.
You are attatching the interrupt to an helper function to call the opject read_AB. This is not necessary. Instead using
attachInterrupt(digitalPinToInterrupt(PIN_A), encoderISR, CHANGE); //call encoderISR() every high->low or low->high changes
You can use:
attachInterrupt(digitalPinToInterrupt(PIN_A), []() { encoder.readAB(); }, CHANGE);
make sure "encoder" has been declared in this context.
This approach is called "lambda function" and is even faster.
Thank you again
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
thank you for providing this code.
You are attatching the interrupt to an helper function to call the opject read_AB. This is not necessary. Instead using
attachInterrupt(digitalPinToInterrupt(PIN_A), encoderISR, CHANGE); //call encoderISR() every high->low or low->high changes
You can use:
make sure "encoder" has been declared in this context.
This approach is called "lambda function" and is even faster.
Thank you again
The text was updated successfully, but these errors were encountered: