-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bob #10
Comments
Thanks for your feedback. I don't fully understand what you mean by "go to the void loop". Do you mean the execution appears to go frozen, or unresponsible? I can think on a possible cause for that, but I have not checked myself. My theory is that the interrupt handle code may be taking too long to complete so the interrupts are interrupting themselves, thus possibly causing all sort of weirdness. To do so just set INTERRUPT_PERIOD to a bigger value in the encoder.h file. The default is 25, which is extremely short for most needs. Try to set it to 50 or 133 as per the comments in the .h file. |
Hi John
I was reluctant to submit this feeling there was something I had missed.
I now have all nine encoders working after changing #define INTERRUPT_PERIOD 250!!!!! I AM VERY, VERY, HAPPY.
I had 4 encoders working _Period 25, after your email 5 encoders working with _PERIOD 50.
9 encoder tried 133 then 125 and finally _PERIOD 250 got them all working.
To try and understand what was happening I put in the:
void loop() {
Serial.print("Top of LOOP");Serial.print(" ");Serial.println(millis());
// X2 = encoder.deltaTick2(); X2new += X2; Single encoder
X1 = enc1.deltaTick2(); X1new += X1;
X2 = enc2.deltaTick2(); X2new += X2;
X3 = enc3.deltaTick2(); X3new += X3;
X4 = enc4.deltaTick2(); X4new += X4;
X5 = enc5.deltaTick2(); X5new += X5;
X6 = enc6.deltaTick2(); X6new += X6;
X7 = enc7.deltaTick2(); X7new += X7;
X8 = enc8.deltaTick2(); X8new += X8;
X9 = enc9.deltaTick2(); X9new += X9;
Then by using the Serial Monitor I could see it print ‘Top of Loop’ + millis() then never get back to the top, it would just freeze..
John please advise how I can make a contribution to yourself for this brilliant coding.
Regards
Bob Telfer
Perth
Western Australia
From: John Lluch Zorrilla ***@***.***
Sent: Friday, 7 October 2022 4:54 PM
To: John-Lluch/Encoder
Cc: idoze1952; Author
Subject: Re: [John-Lluch/Encoder] Bob (Issue #10)
Thanks for your feedback.
I don't fully understand what you mean by "go to the void loop". Do you mean the execution appears to go frozen, or unresponsible?
I can think on a possible cause for that, but I have not checked myself. My theory is that the interrupt handle code may be taking too long to complete so the interrupts are interrupting themselves, thus possibly causing all sort of weirdness.
If that's the case, then this should be solved by reducing the interrupt frequency.
To do so just set INTERRUPT_PERIOD to a bigger value in the encoder.h file. The default is 25, which is extremely short for most needs. Try to set it to 50 or 133 as per the comments in the .h file.
—
Reply to this email directly, view it on GitHub <#10 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/A2YM5XQCWVN34KZJVAK7YZ3WB7QJJANCNFSM6AAAAAAQ7LQSP4> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/A2YM5XXWUSKM3KPJWMKMEQ3WB7QJJA5CNFSM6AAAAAAQ7LQSP6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSLY2V5Y.gif> Message ID: ***@***.***>
|
No problem @idoze1952, I already appreciate your feedback. Have a nice day |
Hello John,
First, Encoder.h is brilliant!, but I have an issue.
I have 9 encoders in my project. I have tested all encoders one by one, they all work correctly with Encoder.h.
I can take any 4 of the encoders in any order (i.e. 1,2,3 & 4 | 3,5,7 & 9 | 1.5.7 & 9) and they work as expected!
However as soon as I increase the number of encoders in the Array to 5 or more, (it compiles OK) but goes into the void loop and never gets out - its a show stopper.
I am reluctant to submit this but I am never going to correct this issue by myself and it may benefit other people.
Thank You
Bob Telfer
The text was updated successfully, but these errors were encountered: