|
Re: Encoders 3-6 Trouble
OK, you can't do what you're trying to do. Kevin Watson's encoder code is intended to decode A and B phase from an encoder. The Banebot encoder/divider "interferes' with this process. ( the input at 2 only looks for ONE signal and so "mis-interperts" the signal from the divider as the A phase so you get data).
You have two options, you can either skip the banebot divider and wire directly to the digital inputs. 3 and 13 ...4 and 14 ...5 and 15... 6 and 16 ... this is where the A and B phase outputs go to the SIG pins. you can connect the + and Minus to one of the +5 and Ground pins of the pair. You can do this as long as you don't exceed 1 Amp. Then, you can just use the Kevin Watson code.
If you want to use the divider, you'll have to write your own interrupt code to calculate the count by incrementing or decrementing (depending on the direction signal) on the signals from the divider.
Wish there were an easier solution but I can't think of one.
Oh and By the way, 1(11), 2(12) use a single signal in a 4 state system. 3 (13) and 4(14) use 2 signals in a 4 state and 5(15) and 6(16) detects all 4 states.
Steve
|