Since the Arduino only has two interrupt lines, we want to save one interrupt line for other applications and use one line to read the Rotary Encoder.
There are two ways of doing so:
The Easy Way
Connect the rotary encoder to the I/O expander, read the value of the A and B pins off the I/O expander and do the "XOR shortcut" with the previous state. See this article.
The Even Easier Way
Purchase the LS7184 integrated circuit (About $3.00 from www.geminielec.com) and connect the rotary encoder to it. The chip will output the clicks and the direction. This will make programming even easier.
No comments:
Post a Comment