Thread: encoders
View Single Post
  #49   Spotlight this post!  
Unread 08-02-2005, 15:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,602
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: encoders

Quote:
Originally Posted by Workaphobia
Second, will Kevin's code work with non-quadrature encoders? I assume it wouldn't - in that case, is it difficult to write my own code to interface with them, or is it as simple as reading an input?

Third, is it possible to use encoders without interrupts, and just poll how many clicks have elapsed, or would polling only return whether or not it is currently clicked?
Kevin's code will work with non-quadrature encoders, as long as you don't hook anything else up to digital inputs 6 or 8. It will only count in one direction, though. You could remove the parts of his code that deal with quadrature fairly easily.

You can handle encoders without interrupts, as long as they tick slowly. If you can guarantee that you poll the pin at twice the rate it transitions, you would be able to poll it reliably.