tag:blogger.com,1999:blog-7396057548824140336.post5962451906475569418..comments2023-07-31T22:42:16.719-07:00Comments on WA0UWH - Electronics & HAM Radio Blog: Decoding a Rotary Encoders - Cont'dEldon R. Brown SRhttp://www.blogger.com/profile/16271671761017534867noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7396057548824140336.post-78443401532199924242011-10-05T21:38:14.300-07:002011-10-05T21:38:14.300-07:00Hello Eldon,
The best source I've found for r...Hello Eldon,<br /><br />The best source I've found for rotary encoder code is: http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino<br /><br />This technique (grey code decoding) enables you to skip the debounce code and increase reliability. The OP code is for pins 0 and 1. I (bikedude) posted code in the thread for pins 2 and 3.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7396057548824140336.post-32053390022522746442011-10-04T10:29:12.595-07:002011-10-04T10:29:12.595-07:00Hello Eldon,
This page explains why you get two in...Hello Eldon,<br />This page explains why you get two interrupts. Then, it's just a matter of choosing the right one.<br />Also, in my code, I use a timer interrupt. You use a direct interrupt. It's a good alternative.<br />http://practicalusage.com/?p=246Roberthttps://www.blogger.com/profile/13851789826843942728noreply@blogger.comtag:blogger.com,1999:blog-7396057548824140336.post-71006398684506941022011-10-03T16:23:38.041-07:002011-10-03T16:23:38.041-07:00Larry,
You are correct, I forgot to cut and paste...Larry,<br /><br />You are correct, I forgot to cut and paste that line, I corrected the blog.<br /><br />EldonEldon R. Brown SRhttps://www.blogger.com/profile/16271671761017534867noreply@blogger.comtag:blogger.com,1999:blog-7396057548824140336.post-85956208345165472312011-10-03T16:12:21.041-07:002011-10-03T16:12:21.041-07:00I think you need to set the encoder0PinB to INPUT ...I think you need to set the encoder0PinB to INPUT as well. And I don't see your attachInterrupt. I was confused by the referenced article talked about rising edge, but attached the interupt to FALLING ?<br />LarryLarry Littlefieldhttps://www.blogger.com/profile/09083659166631020929noreply@blogger.com