I was just planning to use one myself. I'd appreciate seeing the code. Gary On Tue, Oct 11, 2011 at 8:08 AM, wrote: > > All, > > I have been working with a rotary encoder that I am planning to use as > a control for a piece of test > equipment at work. I have looked on the web for algorithms to decode > the outputs of said encoder, > and have found several. Most of them work as advertised in my > application, but I have come up with a > version that works very well in my opinion. > > I don't know whether it is new or novel, but all I have done is watch > for the "A" output to go high. > When it does, I then read the port that the encoder is attached to. I > mask of the bits I am interested > in, and use this as an index into a table. If the value is "01" I add > "1" to my variable. If the value > is "10", I subtract "1" by adding 255. Any other combination "00" or > "11" adds a zero for no change. > > I have tried this out spinning the knob on the encoder as fast as I > can, and I can't see any missed > counts. I am using a delay of 2.5 mS in my routine for debouncing. > > If anyone is interested, I can post the code. But my guess is I have > just on my own rediscovered an old > method of decoding rotary encoders. > > > Regards, > > Jim > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 ---------------------------------------------- Gary A. Crowell Sr., P.E., CID+ Linkedin Elance KE7FIZ --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .