View Single Post
  #2   Spotlight this post!  
Unread 30-03-2008, 15:15
Code Monkey Code Monkey is offline
Registered User
FRC #1622
 
Join Date: Dec 2007
Location: San Diego
Posts: 10
Code Monkey is an unknown quantity at this point
Re: Question about Encoders

you can put the output of a single signal on either the 1-2 dig_io (Encoder1 and Encoder2 in Kevin's code) in which case you will treat them just like gear tooth counters, or, to reduce interrupts, use the 3-4 dig_io (Encoder3 and Encoder4)
and tie the corresponding phase B either high or low so you always get + counts. (Always having + counts lets you use unsigned long int to double your counts before reset).
Make sure you enable the interrupts and the encoders at the top of your code following Kevin's readme and remember the output is a long!

I never have tried to use the rising edge detection to determine direction from a single output encoder or gear tooth counter.

I hope this is still of any value to you. Sorry for not getting this sooner.