-
Notifications
You must be signed in to change notification settings - Fork 243
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
wrong counting backwards #99
Comments
You are using multiple libraries with a high res encoder. The processor may not be able to handle both the precision of the encoder as well as the 4 other libraries. This isn't necessarily an issue in encoder.h as it's written in assembly, it's more likely the libraries you are using may not be optimised. I'd suggest getting it to a working state, then slowly adding your code back in. If it is the processor, consider using 2 arduinos. Also, look at the encoder documentation. You may need to add a debounce if it's too sensitive. Hope this helps. |
Thanks for the advice, Now I have migrated the code to an Arduino Nano ESP32 dividing the work across 2 cores. How can I solve it? Thank you, |
Hi Davide, Does the example code "Basic" work? If so, slowly add your code to that until it crashes again. You should be able to figure out what it is from that. Thanks, |
In fact with the basic code it doesn't crash
there is something that does not depend on the "encoder" library I'm continuing with the investigation Thank you very much, |
Hi Paul, I use your code without problems on an Arduino iot33 with rotary encoder but with a high resolution encoder I see the count is constant but this happens:
counting forward from 0 to 17750,
when I go back I get 3050 (not 0)
then if I go forward I get 20800
and when I go back I get 6100 and so on...
In practice when I go forward I have constant counts of 17750 impulses
while backwards 14700
effectively always losing 3050 when I go back
This is my test code
If I don't use 2 interrupts, the count is completely off.
With or without the "ENCODER OPTIMIZE INTERRUPTS" function the result changes little.
I don't know what it could depend on.
Thank you,
Davide
The text was updated successfully, but these errors were encountered: