Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Question about Encoders (http://www.chiefdelphi.com/forums/showthread.php?t=66376)

beefy23 30-03-2008 09:12

Question about Encoders
 
Can someone explain me how to use Binary encoders which has one signal?
I use MPLAB with kevin`s code.
Thanks :rolleyes:

Code Monkey 30-03-2008 15:15

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.


All times are GMT -5. The time now is 00:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi