|
Re: Keeping track of Encoder Shaft Location using WPI Counter VI
I can't see the forward direction, but the FALSE doesn't work when I plug in some numbers. The first call works, but the second call would subtract far too much.
As an example, assume the shift register is 1000 and the Get Counter value is up by 1010. The returned value is correct at 990, but the value stored in the shift register is also 990. If on the next call, the Get Counter has the same, the code will return 970. If the Get Counter goes up by ten to 1020, then the return value is 960. It seems to me like the right-most subtract is taking the delta from the wrong value. If it takes it from the shift register, then subsequent calls take off more and more. If the delta is subtracted from the Get Counter value, then that seems like it would work.
Greg McKaskle
|