Thursday, March 26, 2009

How to Read Rotary Encoders (II)

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.





 

Update (May, 2011): These posts were done when I was learning how to use Arduino. Latest implementation can be found here: link1, link2, link3

No comments:

Post a Comment