Yes, I use half the resolution, as my encoders have 30 steps but 15 detents. But you're right, you cab double the resolution as you noted. Jan Didden ----- Original Message ----- From: "David P. Harris" To: Sent: Friday, August 03, 2001 7:23 PM Subject: Re: [PIC]: Stumped by rotary encoder > Hi- > Great, i may have a use for it. Just to note, you can double the resolution by > doing the same with the inputs (conceptually) reversed (ie polling B, and using > A to determine direction). With hand turned encoders this probably doesn't > matter, and in fact the lowere resolution might be beneficial (depending if > there are palpable detents). > Cheers, David > > SkinTech wrote: > > > To all who provided advice on interfacing a rotary encoder: > > > > Thanks very much, I got it working OK now! > > The attached is the code fragment to detect movement and direction of an > > encoder. > > The key was the realisation that although these things bounce a lot, you can > > start processing at the first change of state, and ignore the debounce as > > long as you take care not to poll that encoder again within the next 5 mS or > > so. After that time, the bouncing has stopped and it can be polled again. > > > > Cheers, Jan Didden > > > ------------------------------------------------------------------------ > > Name: encoder.txt > > encoder.txt Type: Plain Text (text/plain) > > Encoding: quoted-printable > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu