Quote:
|
Originally Posted by mightywombat
QUOTE:
Connect the signal pin not connected to the interrupt and ground to the signal and ground pins on digital input number 8
I think I know what you are getting at but could you clarify this?
|
Just a clarification of why you are using the signals this way. At least I hope this ends up clarifying things.
In a quadrature encoder you have two signals out of phase by 90 degrees from each other. That's why you have two signal lines. (The word quadrature means 90 degrees.)
When the primary signal line goes high it causes the interrupt (in this case in digital input 1). If you check the second signal line (in this case on digital input 8) at the same time you will see it will always be low when the wheels are rotating in one direction and always high when the wheels are rotating in the opposite direction. So you can add counts going forward and subtract from your count when going backwards.
Think of two square waves offset from each other like this:
____----____---- signal A
__----____----____ signal B
If you think of a vertical line moving from left to right you'll see whenever signal A goes high (---) signal B is always high too (---).
But moving your imaginary vertical line from right to left, whenever signal A goes high (---) signal B is always low (___).
[edit] I had to come back and finish up this explanation later, because my car pool was leaving.
